
    	Pj-u                        d dl mZ d dlmZmZ d dlmZmZmZm	Z	m
Z
mZ d dlmZ d dlmZmZ d dlmZ d dlmZmZ d dlmZmZmZmZ d d	lmZ d d
lmZ d dlZd dlZd dl Z d dl!Z!d dl"Z"d dl#Z#d dl$Z$d dl%Z%d dl&Z&d dl'm(Z( d dl)Z*d dl+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1 d dl2m3Z3 d dl+Z+e+jh                  r
d dl+m5Z5m6Z6m7Z7  G d de      Z8 G d de      Z9 G d de      Z: G d dejv                        Z<e=dk(  r ej|                  e:        e	        yy)    )_unicode)genversion)HTTPResponse	HTTPErrorAsyncHTTPClientmain_RequestProxyHTTPRequest)httputil)HTTP1ConnectionHTTP1ConnectionParameters)IOLoop)StreamClosedErrorIOStream)ResolverOverrideResolver_client_ssl_defaultsis_valid_ip)gen_log)	TCPClientN)BytesIO)DictAnyCallableOptionalTypeUnion)TracebackType)DequeTupleListc                   8     e Zd ZdZdeddf fdZdefdZ xZS )HTTPTimeoutErrorzError raised by SimpleAsyncHTTPClient on timeout.

    For historical reasons, this is a subclass of `.HTTPClientError`
    which simulates a response code of 599.

    .. versionadded:: 5.1
    messagereturnNc                 (    t         |   d|       y NW  r%   super__init__selfr%   	__class__s     L/root/.hermes/venv/lib/python3.12/site-packages/tornado/simple_httpclient.pyr-   zHTTPTimeoutError.__init__5       g.    c                 "    | j                   xs dS )NTimeoutr*   r/   s    r1   __str__zHTTPTimeoutError.__str__8   s    ||(y(r3   __name__
__module____qualname____doc__strr-   r7   __classcell__r0   s   @r1   r$   r$   ,   s'    / / /) )r3   r$   c                   8     e Zd ZdZdeddf fdZdefdZ xZS )HTTPStreamClosedErroraZ  Error raised by SimpleAsyncHTTPClient when the underlying stream is closed.

    When a more specific exception is available (such as `ConnectionResetError`),
    it may be raised instead of this one.

    For historical reasons, this is a subclass of `.HTTPClientError`
    which simulates a response code of 599.

    .. versionadded:: 5.1
    r%   r&   Nc                 (    t         |   d|       y r(   r+   r.   s     r1   r-   zHTTPStreamClosedError.__init__H   r2   r3   c                 "    | j                   xs dS )NStream closedr*   r6   s    r1   r7   zHTTPStreamClosedError.__str__K   s    ||..r3   r8   r?   s   @r1   rA   rA   <   s'    	/ / // /r3   rA   c                   0    e Zd ZdZ	 	 	 	 	 	 	 ddedeeeef      dedee   deeee	f      dee   d	ee   d
df fdZ
d fdZdedeegdf   d
dfdZddZd
efdZdedeg df   deegdf   d
dfdZded
dfdZded
dfdZddedee   d
dfdZ xZS )SimpleAsyncHTTPClienta  Non-blocking HTTP client with no external dependencies.

    This class implements an HTTP 1.1 client on top of Tornado's IOStreams.
    Some features found in the curl-based AsyncHTTPClient are not yet
    supported.  In particular, proxies are not supported, connections
    are not reused, and callers cannot select the network interface to be
    used.

    This implementation supports the following arguments, which can be passed
    to ``configure()`` to control the global singleton, or to the constructor
    when ``force_instance=True``.

    ``max_clients`` is the number of concurrent requests that can be
    in progress; when this limit is reached additional requests will be
    queued. Note that time spent waiting in this queue still counts
    against the ``request_timeout``.

    ``defaults`` is a dict of parameters that will be used as defaults on all
    `.HTTPRequest` objects submitted to this client.

    ``hostname_mapping`` is a dictionary mapping hostnames to IP addresses.
    It can be used to make local DNS changes when modifying system-wide
    settings like ``/etc/hosts`` is not possible or desirable (e.g. in
    unittests). ``resolver`` is similar, but using the `.Resolver` interface
    instead of a simple mapping.

    ``max_buffer_size`` (default 100MB) is the number of bytes
    that can be read into memory at once. ``max_body_size``
    (defaults to ``max_buffer_size``) is the largest response body
    that the client will accept.  Without a
    ``streaming_callback``, the smaller of these two limits
    applies; with a ``streaming_callback`` only ``max_body_size``
    does.

    .. versionchanged:: 4.2
        Added the ``max_body_size`` argument.
    Nmax_clientshostname_mappingmax_buffer_sizeresolverdefaultsmax_header_sizemax_body_sizer&   c                 l   t         |   |       || _        t        j                         | _        i | _        i | _        || _        || _	        || _
        |r|| _        d| _        nt               | _        d| _        |t        | j                  |      | _        t        | j                        | _        y )N)rK   FT)rJ   mapping)rJ   )r,   
initializerG   collectionsdequequeueactivewaitingrI   rL   rM   rJ   own_resolverr   r   r   
tcp_client)	r/   rG   rH   rI   rJ   rK   rL   rM   r0   s	           r1   rP   z SimpleAsyncHTTPClient.initializev   s     	H-& 	
  	  	  /.* $DM %D$JDM $D',0@DM $T]];r3   c                     t         |           | j                  r| j                  j                          | j                  j                          y N)r,   closerV   rJ   rW   )r/   r0   s    r1   rZ   zSimpleAsyncHTTPClient.close   s5    MM!r3   requestcallbackc                    t               }| j                  j                  |||f       |j                  J |j                  J d }t        | j                        | j                  k\  rt        |j                  |j                        xs |j                  xs |j                  }|rV| j                  j                  | j                  j                         |z   t        j                  | j                  |d            }|||f| j                  |<   | j!                          | j                  rAt#        j$                  dt        | j                        t        | j                        fz         y y )Nzin request queuezImax_clients limit reached, request queued. %d active, %d queued requests.)objectrS   appendconnect_timeoutrequest_timeoutlenrT   rG   minio_loopadd_timeouttime	functoolspartial_on_timeoutrU   _process_queuer   debug)r/   r[   r\   keytimeout_handletimeouts         r1   
fetch_implz SimpleAsyncHTTPClient.fetch_impl   sA    h

323&&222&&222t{{t///G++W-D-DE +**+** 
 !%!9!9LL%%''1%%d&6&6=OP" %h?S::MM1474Dc$**o3VW r3   c                    | j                   rt        | j                        | j                  k  r| j                   j	                         \  }}}|| j
                  vr[| j                  |       ||f| j                  |<   t        j                  | j                  |      }| j                  |||       | j                   r$t        | j                        | j                  k  ry y y y rY   )rS   rb   rT   rG   popleftrU   _remove_timeoutrg   rh   _release_fetch_handle_request)r/   rl   r[   r\   release_callbacks        r1   rj   z$SimpleAsyncHTTPClient._process_queue   s    jjS-0@0@@%)ZZ%7%7%9"C($,,&  % '2DKK(001D1DcJ  *:HE jjS-0@0@@j@jr3   c                     t         S rY   )_HTTPConnectionr6   s    r1   _connection_classz'SimpleAsyncHTTPClient._connection_class   s    r3   ru   final_callbackc           
           | j                         | |||| j                  | j                  | j                  | j                         y rY   )rx   rI   rW   rL   rM   )r/   r[   ru   ry   s       r1   rt   z%SimpleAsyncHTTPClient._handle_request   sE     	!   OO  		
r3   rl   c                 >    | j                   |= | j                          y rY   )rT   rj   )r/   rl   s     r1   rs   z$SimpleAsyncHTTPClient._release_fetch   s    KKr3   c                     || j                   v r>| j                   |   \  }}}|| j                  j                  |       | j                   |= y y rY   )rU   rd   remove_timeout)r/   rl   r[   r\   rm   s        r1   rr   z%SimpleAsyncHTTPClient._remove_timeout   sL    $,,04S0A-GX~)++N;S!	 r3   infoc                 D   | j                   |   \  }}}| j                  j                  |||f       |rd| nd}t        |dt	        |      | j
                  j                         |j                  z
        }| j
                  j                  ||       | j                   |= y)zTimeout callback of request.

        Construct a timeout HTTPResponse when a timeout occurs.

        :arg object key: A simple object to mark the request.
        :info string key: More detailed timeout information.
        Timeout r5   r)   )errorrequest_timeN)	rU   rS   remover   r$   rd   rf   
start_timeadd_callback)r/   rl   r~   r[   r\   rm   error_messagetimeout_responses           r1   ri   z!SimpleAsyncHTTPClient._on_timeout   s     -1LL,=)>

323-1(4&)y'"=1**,w/A/AA	
 	!!(,<=LLr3   )
   Ni  @NNNNr&   NrY   )r9   r:   r;   r<   intr   r   r=   r   r   rP   rZ   r   r   r   ro   rj   typerx   rt   r^   rs   rr   ri   r>   r?   s   @r1   rF   rF   O   s_   $P 59('+-1)-'+$<$< #4S>2$< 	$<
 8$$< 4S>*$< "#$<  }$< 
$<L ".6~t7K.L	6F4 

 #2t8,
 !,!56	

 

"& T "6 "d "v Xc] d r3   rF   c                      e Zd Zh dZdee   dedeg df   deegdf   de	de
d	e	d
e	ddfdZd(dZdededeeef   ej$                  f   fdZd)dee   ddfdZd(dZdedefdZdeddfdZd(dZdeddfdZdddee   dee   defdZd(dZ d ee!jD                  e!jF                  f   d!e!jH                  ddfd"Z%defd#Z&d(d$Z'd(d%Z(d&e)ddfd'Z*y)*rw   >   GETPUTHEADPOSTPATCHDELETEOPTIONSclientr[   ru   Nry   rI   rW   rL   rM   r&   c	                    t        j                         | _        | j                  j                         | _        t        j                         | _        || _        || _        || _        || _	        || _
        || _        || _        || _        d | _        d | _        g | _        d | _        d | _        d | _        t        j                         j)                  t+        j,                  | j/                               d        y )Nc                 "    | j                         S rY   result)fs    r1   <lambda>z*_HTTPConnection.__init__.<locals>.<lambda>  s    qxxz r3   )r   currentrd   rf   r   start_wall_timer   r[   ru   ry   rI   rW   rL   rM   codeheaderschunks_decompressor_timeout	_sockaddr
add_futurer   convert_yieldedrun)	r/   r   r[   ru   ry   rI   rW   rL   rM   s	            r1   r-   z_HTTPConnection.__init__   s     ~~',,++-#yy{ 0,.$.*	!##
+-A	
r3   c           	      |  K   	 t         j                  j                  t        | j                  j
                              | _        | j                  j                  dvr"t        d| j                  j
                  z        | j                  j                  }d|v r|j                  d      \  }}}t        j                  |      \  }}|| j                  j                  dk(  rdnd}t        j                  d|      r|dd	 }|| _        | j                  j                   d
u rt"        j$                  }nt"        j&                  }| j)                  | j                  j                        }d }| j                  j*                  rXt-        | j                  j*                        r| j                  j*                  }n"t        d| j                  j*                        | j                  j.                  rK| j                  j0                  r5t3        | j                  j.                  | j                  j0                        }	n\| j                  j.                  r| j                  j.                  }	n/| j                  j0                  r| j                  j0                  }	nd}	|	rL| j4                  j7                  | j8                  |	z   t;        j<                  | j>                  d            | _         | jB                  jE                  ||||| jF                  |       d {   }
| jH                  |
jK                          y |
| _&        | jL                  jO                  | jP                         | jS                          | jH                  y | j                  j0                  r`| j4                  j7                  | j8                  | j                  j0                  z   t;        j<                  | j>                  d            | _         | j                  jT                  | jV                  vr8| j                  jX                  s"t[        d| j                  jT                  z        dD ]'  }t]        | j                  |d       st_        d|z         d| j                  j`                  vrd| j                  j`                  d<   d| j                  j`                  vrd| j                  j                  v r@| j                  j                  j                  d      d	   | j                  j`                  d<   n-| j                  j                  | j                  j`                  d<   d\  }}| j                  jb                  -| j                  jb                  | j                  jd                  }}nF| j                  jf                  0| j                  jf                  }| j                  jh                  xs d}||J | j                  jj                  dvr t        d| j                  jj                        dt        tm        jn                  t        jp                  ||                  z   | j                  j`                  d<   | j                  jr                  r.| j                  jr                  | j                  j`                  d<   nE| j                  j`                  ju                  d       dtv         | j                  j`                  d<   | j                  jX                  s|| j                  jT                  dv }| j                  jx                  d uxs | j                  jz                  d u}|r|r|r,|s*t        d|rd ndd!| j                  jT                  d"      | j                  j|                  rd#| j                  j`                  d$<   | j                  jx                  ?t        t        | j                  jx                              | j                  j`                  d%<   | j                  jT                  d&k(  r1d'| j                  j`                  vrd(| j                  j`                  d'<   | j                  j                  rd)| j                  j`                  d*<   | j                  j                  xs d+| j                  j                  rd,| j                  j                  z   ndz   }| j                  |
      | _E        t        j                  | j                  jT                  |d      }| j                  j                  || j                  j`                         | j                  j|                  r$| j                  j                  |        d {    y | j                  d-       d {    y 7 v7 "7 
# t        $ r%  | j                  t        j                          s Y y w xY ww).N)httphttpszUnsupported url scheme: %s@r   i  P   z^\[.*\]$   Fz=Unrecognized IPv4 or IPv6 address for network_interface, got r   zwhile connecting)afssl_optionsrI   	source_ipzduring requestzunknown method %s)
proxy_host
proxy_portproxy_usernameproxy_passwordproxy_auth_modez%s not supported
ConnectionrZ   Host)NN )Nbasiczunsupported auth_mode %szBasic Authorizationz
User-AgentzTornado/)r   r   r   z
Body must znot zbe None for method z+ (unless allow_nonstandard_methods is true)z100-continueExpectContent-Lengthr   Content-Typez!application/x-www-form-urlencodedgzipzAccept-Encoding/?T)Nurllibparseurlsplitr   r[   urlparsedscheme
ValueErrornetloc
rpartitionr   split_host_and_portrematchparsed_hostname
allow_ipv6socketAF_INET	AF_UNSPEC_get_ssl_optionsnetwork_interfacer   r`   ra   rc   rd   re   r   rg   rh   ri   r   rW   connectrI   ry   rZ   streamset_close_callbackon_connection_closerr   method_SUPPORTED_METHODSallow_nonstandard_methodsKeyErrorgetattrNotImplementedErrorr   usernamepasswordauth_usernameauth_password	auth_modebase64	b64encodeencode_username_password
user_agentgetr   bodybody_producerexpect_100_continuer=   rb   decompress_responsepathquery_create_connection
connectionRequestStartLinewrite_headersread_response_write_body	Exception_handle_exceptionsysexc_info)r/   r   userpass_hostportr   r   r   rn   r   rl   r   r   body_expectedbody_presentreq_path
start_lines                     r1   r   z_HTTPConnection.run   s    ^	 ,,//9I9I0JKDK{{!!):: !=@P@P!PQQ [[''Ff}&,&7&7&<#!V!55f=JD$|"kk00G;sxxT*Abz#'D ||&&%/^^%%//0B0BCKI||--t||==> $ > >I$<<99< 
 ||++0L0LLL00$,,2N2N --,,66--,,66 $ 8 8OOg-%%d&6&68JK!  ??22' $ 4 4# 3  F ""* DKKK**4+C+CD  """*||++ $ 8 8OOdll&B&BB%%d&6&68HI!
 ##4+B+BB>>2T\\5H5HHII H 4<<d3-.@3.FGGH 4<<#7#775<$$\2T\\111$++,,,37;;3E3E3P3PQT3U4DLL((0 48;;3E3EDLL((0!+Hh{{##/%)[[%9%94;;;O;O(++7<<55<<55;#+++<<))@$%?AWAWXX8@8$$ 99(HMD 9$$_5
 ||&&59\\5L5L$$\2%%)),7?7?y5I$$\2<<99 !% 3 37O OLL%%T1 >||11=  ", $ &36:DLL<O<OQ 
 ||//1?$$X.||  , :=SARAR=S9T$$%56##v-"$,,*>*>> 8 $$^4 ||//:@$$%67((/C-1[[->->t{{(((BH #55f=DO!224<<3F3FRTUJOO))*dll6J6JK||//oo33D999&&t,,,UP :, 	)4))3<<>: ;	s   f<L
f f f /f<0Af 8f<9C,f &S>f $f%f )f<*f >f	?f f<f f 	f +f96f<8f99f<r   c                    |dk(  r| j                   j                  | j                   j                  S | j                   j                  rH| j                   j                  2| j                   j                  | j                   j
                  t        S t        j                  t        j                  j                  | j                   j                        }| j                   j                  sd|_        t        j                  |_        | j                   j                  :|j                  | j                   j                  | j                   j
                         t        t        d      r#|xj                   t        j"                  z  c_        |S y )Nr   )cafileFOP_NO_COMPRESSION)r[   r   validate_certca_certsclient_cert
client_keyr   sslcreate_default_contextPurposeSERVER_AUTHcheck_hostname	CERT_NONEverify_modeload_cert_chainhasattroptionsr  )r/   r   ssl_ctxs      r1   r   z _HTTPConnection._get_ssl_options  s    W||''3||/// **LL))1LL,,4LL++3++00''0E0EG <<--).&&)mm#||''3''LL,,dll.E.E s/03#8#88Nr3   r~   c                 ~    d| _         |rd| nd}| j                  !| j                  t        t        |      d       yy)zTimeout callback of _HTTPConnection instance.

        Raise a `HTTPTimeoutError` when a timeout occurs.

        :info string key: More detailed timeout information.
        Nr   r5   )r   ry   r   r$   )r/   r~   r   s      r1   ri   z_HTTPConnection._on_timeout  sG     -1(4&)y*"" "2="A4 +r3   c                 v    | j                   -| j                  j                  | j                          d | _         y y rY   )r   rd   r}   r6   s    r1   rr   z_HTTPConnection._remove_timeout  s.    ==$LL''6 DM %r3   r   c                     |j                  d       t        |dt        d| j                  | j                  t        | j                  j                              | j                        }|S )NT)no_keep_aliverL   rM   
decompress)	set_nodelayr   r   rL   rM   boolr[   r   r   )r/   r   r   s      r1   r   z"_HTTPConnection._create_connection  s`    4 $%" $ 4 4"00 @ @A	 NN


 r3   
start_readc                 &  K   | j                   j                  0| j                  j                  | j                   j                         nQ| j                   j                  ;| j                   j	                  | j                  j                        }|
| d {    | j                  j                          |r%	 | j                  j                  |        d {    y y 7 F7 # t        $ r%  | j                  t        j                          s Y y w xY wwrY   )r[   r   r   writer   finishr   r   r   r   r   )r/   r  futs      r1   r   z_HTTPConnection._write_body  s     <<(OO!!$,,"3"34\\''3,,,,T__-B-BCC		 oo33D999   :$ -t--s||~> ?sH   BDC D7C  CC  DC   +DDDDc                 R    | j                   | j                   }d | _          |        y y rY   )ru   )r/   ru   s     r1   _releasez_HTTPConnection._release  s-      ,#44$(D! -r3   responsec                     | j                          | j                  0| j                  }d | _        | j                  j                  ||       y y rY   )r  ry   rd   r   )r/   r  ry   s      r1   _run_callbackz_HTTPConnection._run_callback  sC    *!00N"&DLL%%nh? +r3   typzOptional[Type[BaseException]]valuetbc           	         | j                   | j                          t        |t              r$|j                  t        d      }n|j                  }| j                  t        | j                  d|| j                  j                         | j                  z
  | j                               t        | d      r| j                  j                          yt        |t              S )NrD   r)   )r   r   r   r   T)ry   rr   
isinstancer   
real_errorrA   r!  r   r[   rd   rf   r   r   r  r   rZ   )r/   r"  r#  r$  s       r1   r   z!_HTTPConnection._handle_exception  s     *  "%!23##+1/BE!,,ELL!%!2!2!4t!F#33 tX& !!# e%677r3   c                     | j                   :d}| j                  j                  r| j                  j                  	 t        |      y # t        $ r$  | j                  t        j                           Y y w xY w)NzConnection closed)ry   r   r   rA   r   r   r   )r/   r%   s     r1   r   z#_HTTPConnection.on_connection_closeB  sl    *)G{{  kk'''8+G44 + ) 8&&&78s   A *A54A5
first_liner   c                 `  K   t        |t        j                        sJ | j                  j                  r)|j
                  dk(  r| j                  d       d {    y |j
                  | _        |j                  | _        || _        | j                         ry | j                  j                  }| j                  j                  d|z         | j                  j                         D ]&  \  }}| j                  j                  | d| d       ( | j                  j                  d       y y 7 ӭw)Nd   Fz
%s %s %s
z: z
)r&  r   ResponseStartLiner[   r   r   r   reasonr   _should_follow_redirectheader_callbackget_all)r/   r)  r   kvs        r1   headers_receivedz _HTTPConnection.headers_receivedL  s     
 *h&@&@AAA<<++
30F""5)))OO	 '''')<<''3LL((*)DE,,. >1,,s"QCt_=>LL((0 4 *s   AD.D,CD.c                    | j                   j                  rp| j                   j                  J | j                  dv xrH | j                   j                  dkD  xr- | j                  d uxr | j                  j                  d      d uS y)N)-  .  /  i3  i4  r   LocationF)r[   follow_redirectsmax_redirectsr   r   r   r6   s    r1   r.  z'_HTTPConnection._should_follow_redirectc  s    <<((<<--999		66 =LL..2=LL,= LL$$Z0<	 r3   c           
         | j                   J dj                  | j                        }| j                          t	        | j
                  d| j
                        }| j                         rt        | j
                  t              sJ | j                  J t        j                  | j
                  j
                        }t        j                  j                  | j
                  j                  | j                  d         |_        | j
                  j                  j                         |_	        t        j                  j                  |j                        }t        j                  j                  |j                        }|j                   |j                   k7  s|j"                  |j"                  k7  rd |_        d |_        d|j"                  v rT|j(                  |j*                   d|j(                   }n|j*                  J |j*                  }|j-                  |      }t        j                  j/                  |      |_        dD ]  }	 |j                  |=  | j
                  j2                  J | j
                  j2                  dz
  |_        |j                  d	= | j                   d
k(  r| j
                  j4                  dk7  s'| j                   dv r<| j
                  j4                  dk(  r#d|_        d |_        dD ]  }	 |j                  |=  ||_        | j:                  d | _        | j=                          | j>                  J | j>                  jA                  |d      }|jC                  fd       | jE                          y | j
                  jF                  rtI               }	ntI        |      }	tK        || j                   t	        | dd       | j                  | jL                  jO                         | jP                  z
  | jR                  |	| j
                  j                        }
| jU                  |
       | jE                          y # t0        $ r Y w xY w# t0        $ r Y lw xY w)Nr3   original_requestr8  r   :)r   )r   Cookier   r   r7  r   )r5  r6  r   r   )r   r   zContent-EncodingzTransfer-EncodingF)raise_errorc                 0     | j                               S rY   r   )r   ry   s    r1   r   z(_HTTPConnection.finish.<locals>.<lambda>  s    N188:,F r3   r-  )r-  r   r   r   buffereffective_url)+r   joinr   rr   r   r[   r.  r&  r
   r   copyr   r   urljoinr   r   r   r   r   r   r   hostname_replace
urlunsplitr   r:  r   r   r<  ry   r  r   fetchadd_done_callback_on_end_requeststreaming_callbackr   r   rd   rf   r   r   r!  )r/   datar<  new_requestparsed_orig_urlparsed_new_url
new_netlochr  rA  r  ry   s              @r1   r  z_HTTPConnection.finishn  s   yy$$$xx$"4<<1CT\\R'')dllM:::<<+++))DLL$8$89K$ll22  $,,z":KO #',,"6"6";";"=K$ll334D4H4HIO#\\22;??CN&&.*?*??"))^-B-BB  -1),0).///%**6(6(?(?'@.BUBUAV%W
-66BBB%3%<%<
%3%<%<J%<%ON"(,,"9"9."I4 A'//2
 <<--999(,(B(BQ(FK%##F+ 		S T\\%8%8F%B		Z'DLL,?,?6,I%*"#'  	A'//2	 ,<K(!00N"&DMMO;;***++##KU#CC!!"FG  "<<**YFT]FII440LL**,t>++,,**	
 	8$k $ 6 $ s$   QQ	QQ	Q+*Q+c                 8    | j                   j                          y rY   )r   rZ   r6   s    r1   rK  z_HTTPConnection._on_end_request  s    r3   chunkc                     | j                         ry | j                  j                  | j                  j                  |       y | j                  j	                  |       y rY   )r.  r[   rL  r   r_   )r/   rT  s     r1   data_receivedz_HTTPConnection.data_received  sE    '')<<**6LL++E2KKu%r3   r   rY   )+r9   r:   r;   r   r   rF   r   r   r   r   r   r-   r   r=   r   r   r   r  
SSLContextr   ri   rr   r   r   r   r  r   r  r!  BaseExceptionr   r   r   r   r,  r   HTTPHeadersr3  r.  r  rK  bytesrV   r3   r1   rw   rw      s   U
./
 
 #2t8,	

 !,!56
 
 
 
 
 

B_B	tT#s(^S^^3	4>  !
 o D T @l @t @"8,"8 &"8 ]#	"8
 
"8H81(44h6O6OOP1 %%1 
	1.	 	cJ&5 &T &r3   rw   __main__)?tornado.escaper   tornador   r   tornado.httpclientr   r   r   r	   r
   r   r   tornado.http1connectionr   r   tornado.ioloopr   tornado.iostreamr   r   tornado.netutilr   r   r   r   tornado.logr   tornado.tcpclientr   r   rQ   rD  rg   r   r   r  r   rf   ior   urllib.parser   typingr   r   r   r   r   r   typesr   TYPE_CHECKINGr    r!   r"   r$   rA   rF   HTTPMessageDelegaterw   r9   	configurer[  r3   r1   <module>rm     s    #     N ! 8    '     	  
 
    = =  	)))y ) /I /&jO jZa&h22 a&H zO34F r3   