python (3.11.7)

(root)/
lib/
python3.11/
http/
__pycache__/
client.cpython-311.opt-1.pyc

eNdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Zddlm
Z
gdZdZdZdZdZd	Zd
ZeejjdejjDZdZd
ZejdjZejdj Z!ejdZ"ejdZ#hdZ$d>dZ%de&de&fdZ'Gddej(j)Z*dZ+e*fdZ,Gddej-Z.GddZ/	ddl0Z0Gd d!e/Z1e2d!n#e3$rYnwxYwGd"d#e4Z5Gd$d%e5Z6Gd&d'e5Z7Gd(d)e5Z8Gd*d+e5Z9Gd,d-e5Z:Gd.d/e5Z;Gd0d1e5Z<Gd2d3e<Z=Gd4d5e<Z>Gd6d7e<Z?Gd8d9e5Z@Gd:d;e5ZAGd<d=eBe@ZCe5ZDdS)?a
HTTP/1.1 client library

<intro stuff goes here>
<other stuff, too>

HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:

    (null)
      |
      | HTTPConnection()
      v
    Idle
      |
      | putrequest()
      v
    Request-started
      |
      | ( putheader() )*  endheaders()
      v
    Request-sent
      |\_____________________________
      |                              | getresponse() raises
      | response = getresponse()     | ConnectionError
      v                              v
    Unread-response                Idle
    [Response-headers-read]
      |\____________________
      |                     |
      | response.read()     | putrequest()
      v                     v
    Idle                  Req-started-unread-response
                     ______/|
                   /        |
   response.read() |        | ( putheader() )*  endheaders()
                   v        v
       Request-started    Req-sent-unread-response
                            |
                            | response.read()
                            v
                          Request-sent

This diagram presents the following rules:
  -- a second request may not be started until {response-headers-read}
  -- a response [object] cannot be retrieved until {request-sent}
  -- there is no differentiation between an unread response body and a
     partially read response body

Note: this enforcement is applied by the HTTPConnection class. The
      HTTPResponse class does not enforce this state machine, which
      implies sophisticated clients may accelerate the request/response
      pipeline. Caution should be taken, though: accelerating the states
      beyond the above pattern may imply knowledge of the server's
      connection-close behavior for certain requests. For example, it
      is impossible to tell whether the server will close the connection
      UNTIL the response headers have been read; this means that further
      requests cannot be placed into the pipeline until it is known that
      the server will NOT be closing the connection.

Logical State                  __state            __response
-------------                  -------            ----------
Idle                           _CS_IDLE           None
Request-started                _CS_REQ_STARTED    None
Request-sent                   _CS_REQ_SENT       None
Unread-response                _CS_IDLE           <response_class>
Req-started-unread-response    _CS_REQ_STARTED    <response_class>
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
N)urlsplit)HTTPResponseHTTPConnection
HTTPExceptionNotConnectedUnknownProtocolUnknownTransferEncodingUnimplementedFileModeIncompleteRead
InvalidURLImproperConnectionStateCannotSendRequestCannotSendHeaderResponseNotReady
BadStatusLineLineTooLongRemoteDisconnectederror	responsesPiUNKNOWNIdlezRequest-startedzRequest-sentci|]
}||jS)phrase).0vs  ?/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/http/client.py
<dictcomp>rlsGGGQQGGGids[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]z[-]>PUTPOSTPATCHdatac
	|dS#t$r[}t|j|j|j|j|d||j|jdd|ddd}~wwxYw)z<Call data.encode("latin-1") but show a better error message.latin-1z (z.20z) is not valid Latin-1. Use z9.encode('utf-8') if you want to send it encoded in UTF-8.N)encodeUnicodeEncodeErrorencodingobjectstartendtitle)r%nameerrs   r_encoder1s
E{{9%%%EEE LJIGZZ\\\\4	#' 12222DDD
:;;AE	EEs
A<AA77A<enc_namereturncF|d\}}}|r|dz
}|S)z)Remove interface scope from IPv6 address.%])	partition)r2percent_s   r_strip_ipv6_ifacer:s3#--d33HgqDOr ceZdZdZdS)HTTPMessagec8|dz}t|}g}d}|D]Z}|d||krd}n|ddsd}|r||[|S)aFind all header lines matching a given header name.

        Look through the list of headers and find all lines matching a given
        header name (and their continuation lines).  A list of the lines is
        returned, without interpretation.  If the header does not occur, an
        empty list is returned.  If the header occurs multiple times, all
        occurrences are returned.  Case is not important in the header name.

        :rN)lowerlenkeysisspaceappend)selfr/nlsthitlines      rgetallmatchingheadersz!HTTPMessage.getallmatchingheadersszz||c!IIIIKK	!	!DBQBx~~4''"1"X%%''

!

4   
r N)__name__
__module____qualname__rJrr rr<r<s#r r<c(g}	|tdz}t|tkrtd||t|t
krt
dt
z|dvrn|S)zReads potential header lines into a list from a file pointer.

    Length of line is limited by _MAXLINE, and number of
    headers is limited by _MAXHEADERS.
    Tr?header linezgot more than %d headers

r )readline_MAXLINErArrD_MAXHEADERSr)fpheadersrIs   r
_read_headersrXsG{{8a<((t99xm,,,tw<<+%% :[ HIII(((Nr ct|}d|d}tj||S)aGParses only RFC2822 headers from a file pointer.

    email Parser wants to see strings rather than bytes.
    But a TextIOWrapper around self.rfile would buffer too many bytes
    from the stream, bytes which we later need to read as bytes.
    So we read the correct bytes here, as bytes, for email Parser
    to parse.

    r 
iso-8859-1)_class)rXjoindecodeemailparserParserparsestr)rVr[rWhstrings    r
parse_headersrcsWBGhhw&&|44G<f--66w???r ceZdZd"dZdZdZdZdZfdZfd	Z	d
Z
dZd#dZd
Z
dZdZdZd#dZdZdZdZd$dZd$dZd$fd	ZdZdZdZd#dZdZdZdZd Zd!Z xZ!S)%rrNc|d|_||_||_dx|_|_t|_t|_t|_	t|_
t|_t|_t|_
dS)Nrb)makefilerV
debuglevel_methodrWmsg_UNKNOWNversionstatusreasonchunked
chunk_leftlength
will_close)rEsockrhmethodurls     r__init__zHTTPResponse.__init__sl--%%$#'&tx ""r ct|jtdzd}t	|tkrtd|jdkrtdt||std	|
dd\}}}n?#t$r2	|
dd\}}d}n#t$rd}YnwxYwYnwxYw|d	s#|
t|	t|}|d
ks|dkrt|n#t$rt|wxYw|||fS)Nr?rZzstatus linerzreply:z-Remote end closed connection without responsezHTTP/r!i)strrVrSrTrArrhprintreprrsplit
ValueError
startswith_close_connrint)rErIrlrmrns     r_read_statuszHTTPResponse._read_statuss47##HqL11<@@t99xm,,,?Q(DJJ'''	2%&122
2	&*jjq&9&9#GVVV			
"&**T1"5"5



		!!'**	&%%%	&[[F||v||#D))) ,	&	&	&%%%	&&&sBB--
C)8CC)C# C)"C##C)(C)%*EE*c|jdS	|\}}}|tkrn1t|j}|jdkrt
d|~U|x|_|_|	|_
|dvrd|_n,|drd|_nt|t|jx|_|_|jdkr3|jD]\}}t
d|d	z||jd
}|r'|dkrd|_d|_nd|_||_d|_|jd
}|rF|js?	t1||_|jdkrd|_n#t2$r
d|_YnwxYwd|_|t4ks%|t6ksd|cxkrdks
n|jdkrd|_|js|js|j
d|_dSdSdSdS)NTrzheaders:)zHTTP/1.0zHTTP/0.9
zHTTP/1.header:r>transfer-encodingroFcontent-lengthr!HEAD)rWrCONTINUErXrVrhr{codermstriprnrlrrrcrjitemsgetr@rorp_check_closerrrqrr~
NO_CONTENTNOT_MODIFIEDri)	rErlrmrnskipped_headershdrvaltr_encrqs	         rbeginzHTTPResponse.begin>s<#F	 &*&7&7&9&9#GVV!!+DG44O""j/222	 #)(	DKllnn...DLL


	
*
*	+DLL!'***"/"8"88tx?Q L..00
1
1SisC0000!!"566	!fllnn	11DL"DOO DL++--!!"233		$,		
'!&kk;??"&DK	
#
#
#"
#DK
j  Fl$:$:6CLF""DK
	#	#K"DOOO	#	#	#	#s+GG&%G&c\|jd}|jdkr|rd|vrdSdS|jdrdS|rd|vrdS|jd}|rd|vrdSdS)N
connectionrcloseTFz
keep-alivezproxy-connection)rWrrlr@)rEconnpconns   rrzHTTPResponse._check_closes|--<2
4::<<//t5<L))	5	LDJJLL005  !344	\U[[]]225tr cJ|j}d|_|dSN)rVr)rErVs  rrzHTTPResponse._close_conns!
W





r c	t|jr|dSdS#|jr|wwxYwr)superrrVrrE	__class__s rrzHTTPResponse.closesl	#GGMMOOOw
#  """""
#
#tw
#  """"
#s AA ct|jr|jdSdSr)rflushrVrs rrzHTTPResponse.flushs;


7	GMMOOOOO		r cdS)zAlways returns TrueTrrEs rreadablezHTTPResponse.readablestr c|jduS)z!True if the connection is closed.N)rVrs risclosedzHTTPResponse.isclosedsw$r c|jdS|jdkr|dS|jr||S||j||jkr|j}|j|}|s|r|n?|j8|xjt|zc_|js||S|j|j}nF	||j}n##t$r|wxYwd|_||S)z?Read and return the response body, or up to the next amt bytes.Nr rr)
rVrirro
_read_chunkedrqreadrA
_safe_readr)rEamtss   rrzHTTPResponse.readsm7?3<6!!3<	+%%c***?{&3+<+<kS!!A
'
'  """"(s1vv%{'$$&&&H{"GLLNN44AA%$$&&& Hs8D D3c|jdS|jdkr|dS|jr||S|j4t
||jkrt|d|j}|j|}|s|r|n2|j+|xj|zc_|js||S)z^Read up to len(b) bytes into bytearray b and return the number
        of bytes read.
        Nrr)	rVrirro_readinto_chunkedrqrA
memoryviewreadinto)rEbrFs   rrzHTTPResponse.readintos
7?1<6!!1<	-))!,,,;"1vv##qMM!DK-0

GQ	#Q	#

[
$KK1KK;
#  """r cF|jtdz}t|tkrt	d|d}|dkr
|d|}	t
|dS#t$r|wxYw)Nr?z
chunk size;r)	rVrSrTrArfindrr~r)rErIis   r_read_next_chunk_sizez"HTTPResponse._read_next_chunk_sizesw1--t99xl+++IIdOO668D	tR== 			
		s0B B c	|jtdz}t|tkrt	d|sdS|dvrdST)NTr?ztrailer linerP)rVrSrTrArrErIs  r_read_and_discard_trailerz&HTTPResponse._read_and_discard_trailer#sd		7##HqL11D4yy8##!.111
,,,		r c|j}|s||d	|}n#t$rt	dwxYw|dkr*||d}||_|S)Nrxr r)rprrr~rrr)rErps  r_get_chunk_leftzHTTPResponse._get_chunk_left1s_
	)%"""
*!7799


*
*
*$S)))
*Q..000  """!
(DOs	7Acg}		|}|nr|9||kr3|||||z
|_n7||||||z}d|_d|S#t
$r(}td||d}~wwxYw)NTrr )rrDrrpr\r)rErvaluerpexcs     rrzHTTPResponse._read_chunkedIs	;

$!1133
%?sj'8'8LL!5!5666&03&6DOT__Z88999?:%C"#

$88E??"	;	;	; %11s:	;sBB##
C-#CCcd}t|}		|}||St||kr$||}||z
|_||zS|d|}||}||d}||z
}d|_#t
$r%tt
|d|wxYw)Nr)rrrA_safe_readintorprbytes)rErtotal_bytesmvbrprFtemp_mvbs       rrzHTTPResponse._readinto_chunked_smm	:
$!1133
%&&s88z))++C00A&01nDO&?*{
{+''11!""gq "#
$ 	:	:	: q;'7!8!8999	:sB6B#6B/Cc|j|}t||kr t||t|z
|S)aRead the number of bytes requested.

        This function should be used when <amt> bytes "should" be present for
        reading. If the bytes are truly not available (due to EOF), then the
        IncompleteRead exception can be used to detect the problem.
        )rVrrAr)rErr%s   rrzHTTPResponse._safe_readwsEw||C  t99s?? s3t99}555r ct|}|j|}||kr(tt	|d|||z
|S)z2Same as _safe_read, but for reading into a buffer.N)rArVrrr)rErrrFs    rrzHTTPResponse._safe_readintosR!ffGQs77 q!us1u555r cR|j|jdkrdS|jr||S|j|dks||jkr|j}|j|}|s|r|n$|j|xjt|zc_|S)zvRead with at most one underlying system call.  If at least one
        byte is buffered, return that instead.
        Nrr r)rVriro_read1_chunkedrqread1rrA)rErFresults   rrzHTTPResponse.read1s7?dlf443<	*&&q)));"AT[Aq!!	'!	'
[
$KK3v;;&KK
r c|j|jdkrdS|jr||S|j|S)Nrr )rVriro
_peek_chunkedpeek)rErFs  rrzHTTPResponse.peeksL7?dlf443<	)%%a(((w||Ar cl|j|jdkrdS|jr!t|S|j|dks||jkr|j}|j|}|s|r|n$|j|xjt|zc_|S)Nrr r)rVrirorrSrqrrA)rElimitrrs   rrSzHTTPResponse.readlines7?dlf443<	+77##E***;"		UT[5H5HKE!!%((	'%	'
[
$KK3v;;&KK
r c|}||dkrdSd|cxkr|ksn|}|j|}|xjt	|zc_|std|S)Nrr )rrVrrprAr)rErFrprs    rrzHTTPResponse._read1_chunkeds))++
a3Q$$$$*$$$$Aw}}Q3t99$	& %%%r c	|}n#t$rYdSwxYw|dS|j|d|S)Nr )rrrVr)rErFrps   rrzHTTPResponse._peek_chunkedsf	--//JJ			33	3w||J''44s
%%c4|jSr)rVfilenors rrzHTTPResponse.filenosw~~r c|jt|j|p|}t|tst|ds|Sd|S)axReturns the value of the header matching *name*.

        If there are multiple matching headers, the values are
        combined into a single string separated by commas and spaces.

        If no matching header is found, returns *default* or None if
        the *default* is not specified.

        If the headers are unknown, raises http.client.ResponseNotReady.

        N__iter__z, )rWrget_all
isinstancerzhasattrr\)rEr/defaultrWs    r	getheaderzHTTPResponse.getheadersl<"$$$,&&t,,7gs##	&77J+G+G	&N99W%%%r cx|jtt|jS)z&Return list of (header, value) tuples.)rWrlistrrs r
getheaderszHTTPResponse.getheaderss2<"$$$DL&&(()))r c|Srrrs rrzHTTPResponse.__iter__sr c|jS)ajReturns an instance of the class mimetools.Message containing
        meta-information associated with the URL.

        When the method is HTTP, these headers are those returned by
        the server at the head of the retrieved HTML page (including
        Content-Length and Content-Type).

        When the method is FTP, a Content-Length header will be
        present if (as is now usual) the server passed back a file
        length in response to the FTP retrieval request. A
        Content-Type header will be present if the MIME type can be
        guessed.

        When the method is local-file, returned headers will include
        a Date representing the file's last-modified time, a
        Content-Length giving file size, and a Content-Type
        containing a guess at the file's type. See also the
        description of the mimetools module.

        )rWrs rinfozHTTPResponse.infos*|r c|jS)aZReturn the real URL of the page.

        In some cases, the HTTP server redirects a client to another
        URL. The urlopen() function handles this transparently, but in
        some cases the caller needs to know which URL the client was
        redirected to. The geturl() method can be used to get at this
        redirected URL.

        )rurs rgeturlzHTTPResponse.geturl
sxr c|jS)zuReturn the HTTP status code that was sent with the response,
        or None if the URL is not an HTTP URL.

        )rmrs rgetcodezHTTPResponse.getcodes
{r )rNNr)r)"rKrLrMrvrrrrrrrrrrrrrrrrrrrrSrrrrrrrrr
__classcell__rs@rrrs)####<'''BF#F#F#P:
#####
&&&&P   D 0;;;;,:::0


"





555   &&&&(***
.


r rceZdZdZdZeZeZdZ	dZ
edZedZ
dejddfd	Zd d
ZdZdZd
ZdZdZdZdZdZd!dZ		d"dZdZdZdZdZdZ d#dddZ!difdddZ"dZ#dZ$dS)$rrzHTTP/1.1r?rc6t|tjS)zFTest whether a file-like object is a text or a binary stream.
        )rio
TextIOBase)streams r
_is_textIOzHTTPConnection._is_textIO's&"-000r c||tvrdSdSt|drdS	t|}|jS#t
$rYnwxYwt
|trt|SdS)aGet the content-length based on the body.

        If the body is None, we set Content-Length: 0 for methods that expect
        a body (RFC 7230, Section 3.3.2). We also set the Content-Length for
        any method if the body is a str or bytes-like object and not a file.
        Nrr)	upper_METHODS_EXPECTING_BODYrrnbytes	TypeErrorrrzrA)bodyrtmvs   r_get_content_lengthz"HTTPConnection._get_content_length-s<||~~!888qt4  	4	D!!B9			D	dC  	t99tsA
AAN cF||_||_||_d|_g|_d|_t|_d|_d|_	d|_
i|_|||\|_
|_||j
t j|_dSr)timeoutsource_address	blocksizers_buffer_HTTPConnection__response_CS_IDLE_HTTPConnection__stateri_tunnel_host_tunnel_port_tunnel_headers
_get_hostporthostport_validate_hostsocketcreate_connection_create_connection)rErrrrrs      rrvzHTTPConnection.__init__Ms,"	  !!%!3!3D$!?!?DIDI&&&#)":r c|jrtd|||\|_|_|r	||_dS|jdS)aDSet up host and port for HTTP CONNECT tunnelling.

        In a connection that uses HTTP CONNECT tunneling, the host passed to the
        constructor is used as a proxy server that relays all communication to
        the endpoint passed to `set_tunnel`. This done by sending an HTTP
        CONNECT request to the proxy server when the connection is established.

        This method must be called before the HTTP connection has been
        established.

        The headers argument should be a mapping of extra HTTP headers to send
        with the CONNECT request.
        z.Can't set up tunnel for established connectionN)rsRuntimeErrorrrrrclear)rErrrWs    r
set_tunnelzHTTPConnection.set_tunnelcso9	QOPPP/3/A/A$/M/M,4,	)#*D    &&(((((r c||d}|d}||krm	t||dzd}nF#t$r9||dzddkr|j}nt	d||dzdzYnwxYw|d|}n|j}|r"|ddkr|ddkr
|dd}||fS)	Nr>]r?ryznonnumeric port: '%s'r[r)rfindrr~default_portr)rErrrjs     rrzHTTPConnection._get_hostport{s<

3A

3A1uuOtAaCDDz??DD!OOOAaCDDzR''#0()@4!:)MNNNO
BQBx(
"Q348s??AbDzd|sAABBc||_dSr)rh)rElevels  rset_debuglevelzHTTPConnection.set_debuglevels
r cd|jd|jfz}|g}|jD]3\}}||d|dd4|d|d|~||j	|j
}	|\}}}|tj
jkr;|t!d	|d
|	|jt(dz}	t+|	t(krt-d
|	sn3|	dvrn.|jdkr"t1d|	|dS#|wxYw)NsCONNECT %s:%d HTTP/1.0
asciiz: 
r'rQr rtzTunnel connection failed:  Tr?rOrPrr)rr(rrrrDsendr\response_classrsrirhttp
HTTPStatusOKrOSErrorrrVrSrTrArrhr{r])
rEconnectrWheaderrresponserlrmessagerIs
          r_tunnelzHTTPConnection._tunnels/$$W--t/@3BB)!17799	G	GMFENNf33333::9EEFFFFw	
		#((7##$$$&&ty&FF	'/'<'<'>'>$WdGt)))

S4SS'--//SSTTT
4{++HqL99t99x''%m444000?Q&&)T[[]]333
4
NNHNNs
C(GG)ctjd||j|j||j|jf|j|j|_	|jtj
tjdn-#t$r }|j
tjkrYd}~nd}~wwxYw|jr|dSdS)z3Connect to the host and port specified in __init__.zhttp.client.connectr?N)sysauditrrrrrrs
setsockoptr
IPPROTO_TCPTCP_NODELAYr$errnoENOPROTOOPTrr)rEes  rr%zHTTPConnection.connects	'ty$)DDD++
Yty!4<1DFF		I  !3V5GKKKK			w%+++,++++		LLNNNNN		s0B
B0B++B0ct|_	|j}|rd|_||j}|rd|_|dSdS#|j}|rd|_|wwxYw)z(Close the connection to the HTTP server.N)rrrsrr)rErsr's   rrzHTTPConnection.closes		!9D
 	

H
!"&     
!
!H
!"&    
!s$A'Bc||j*|jr|nt|jdkrtdt
|t|dr|jdkrtd||}|r|jdkrtd	|	|j
}|snH|r|d}tj
d	|||j|edStj
d	||	|j|dS#t$rat!|t"jjr"|D]}|j|YdStd
t)|zwxYw)zSend `data' to the server.
        ``data`` can be a string object, a bytes object, an array object, a
        file-like object that supports a .read() method, or an iterable object.
        Nrzsend:rzsending a readableencoding file using iso-8859-1r?rZzhttp.client.sendz9data should be a bytes-like object or an iterable, got %r)rs	auto_openr%rrhr{r|rrrrr(r+r,sendallrrcollectionsabcIterabletype)rEr%r(	datablockds     rrzHTTPConnection.sends9~
%"nn$?Q'4::&&&4  	""*+++__T**F
8$/A--6777
- IIdn55	 ? ) 0 0 > >I	,dI>>>	!!),,,
-
F	$dD111	GId#####	G	G	G$ 899
G))AI%%a(((())) !9;?::!FGGG	Gs4EAF; F;c:|j|dS)zuAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N)rrD)rErs  r_outputzHTTPConnection._outputs 
	
Ar c#K|jdkrtd||}|r|jdkrtd	||j}|sdS|r|d}|V:)Nrzreading a readabler6TrZ)rhr{rrrr()rErr(r=s    r_read_readablezHTTPConnection._read_readables?Q&'''**	4do))2333	 

dn55I

;%,,\::	OOO
	r Fc|jdd|j}|jdd=|||t	|dr||}nb	t
||f}nN#t$rA	t|}n-#t$r tdt|zwxYwYnwxYw|D]m}|s|j
dkrtd|r7|jdkr,t|d	d
d|zdz}||n|r$|jdkr|ddSdSdSdS)
zSend the currently buffered request and clear the buffer.

        Appends an extra \r\n to the buffer.
        A message_body may be specified, to be appended to the request.
        )r r rQNrzAmessage_body should be a bytes-like object or an iterable, got %rrzZero length chunk ignoredrXrrs0

)rextendr\rrrBrriterr<rhr{	_http_vsnrAr()rEmessage_bodyencode_chunkedrjchunkschunks      r_send_outputzHTTPConnection._send_outputs	
J'''ll4<((LO		##|V,,
-,,\::-
|,,,+_FF!>>>>!%l!3!3$>>>')H*.|*<*<)=>>>>> 

!

!**9:::!"dn&:&:"5zz111188AAEI!"E		%    
($.B"6"6		,'''''S$#N
(
("6"6s*>B
CB,+C,*CCCc|jr |jrd|_|jtkr
t|_nt|j||||_|pd}|||d|d|j	}|
|||jdkrz|s[d}|
drt|\}}}}}|r`	|d}n%#t $r|d}YnwxYw|d	t%|n|jr|j}	|j}
n|j}	|j}
	|	d}n%#t $r|	d}YnwxYwd
|	vrd|zdz}t%|}|
|jkr|d	|n0|d}|d	|d
|
|s|d
ddSdSdS)a`Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
        `skip_host' if True does not add automatically a 'Host:' header
        `skip_accept_encoding' if True does not add automatically an
           'Accept-Encoding:' header
        N/rrryr!ridnaHostr>[r6zAccept-Encodingidentity)rrrr_CS_REQ_STARTEDr_validate_methodri_validate_path
_http_vsn_strr@_encode_requestrGrrr(r)	putheaderr:rrrrrr])rErtru	skip_hostskip_accept_encodingrequestnetlocnil
netloc_encrrhost_encs            r
putrequestzHTTPConnection.putrequestEs?	#t7799	#"DO*<8##*DLL#DL111f%%%jSC    &T-?-?@T))'22333>R1
K>>&))?19#.Cc3K;%+]]7%;%;

-;;;%+]]6%:%:


;NN6+<Z+H+HIIII()#0#0#y#y7#';;w#7#7-777#';;v#6#67d{{#'(?T#9#4X#>#>t000vx8888#+??7#;#;v(((DD/IJJJ(
>0*=====
>
>
Ds$DD;:D;FF?>F?c,|dS)Nr)r()rEr[s  rrWzHTTPConnection._encode_requests~~g&&&r ct|}|r(td|d|ddS)z&Validate a method name for putrequest.z)method can't contain control characters.  (found at least )N)$_contains_disallowed_method_pchar_researchr~group)rErtmatchs   rrTzHTTPConnection._validate_methodsf5;;FCC	;:::',{{}}:::;;
;	;	;r ct|}|r(td|d|ddS)zValidate a url for putrequest.&URL can't contain control characters. rcrdN!_contains_disallowed_url_pchar_rerfrrg)rErurhs   rrUzHTTPConnection._validate_pathsr288==	DCcCC05

CCCDD
D	D	Dr ct|}|r(td|d|ddS)z9Validate a host so it doesn't contain control characters.rjrcrdNrk)rErrhs   rr	zHTTPConnection._validate_hostsr288>>	DCdCC05

CCCDD
D	D	Dr c|jtkrtt|dr|d}t|st
d|t|}t|D]\}}t|dr|d||<n:t|tr%t|d||<t||rt
d||d
|}|dz|z}||dS)	zkSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        r(rzInvalid header name r'zInvalid header value s
	s: N)rrSrrr(_is_legal_header_namer~r	enumeraterrrz_is_illegal_header_valuer\r@)rEr&valuesr	one_valuers      rrXzHTTPConnection.putheadersU
<?**"$$$68$$	,]]7++F$V,,	C*ABBBf%f--	K	KLAyy(++
;%,,Y77q		Is++
;	NN11'::q	'q	22
K jfQii!IJJJ
Kv&&%%'Vr rIc|jtkr
t|_nt|||dS)zIndicate that the last header line has been sent to the server.

        This method sends the request to the server.  The optional message_body
        argument can be used to pass a message body associated with the
        request.
        rtN)rrS_CS_REQ_SENTrrL)rErHrIs   r
endheaderszHTTPConnection.endheaderssE<?**'DLL"$$$,~FFFFFr c8||||||dS)z&Send a complete request to the server.N)
_send_request)rErtrurrWrIs      rr[zHTTPConnection.requests&	
63g~FFFFFr cVtd|D}i}d|vrd|d<d|vrd|d<|j||fi|d|vrzd|vrud	}|||}|8|5|jd
krt	d|zd}|d
dn&|dt
|nd	}|D]\}	}
||	|
t|trt|d}|
||dS)Nc3>K|]}|VdSr)r@)rks  r	<genexpr>z/HTTPConnection._send_request.<locals>.<genexpr>s* < <q < < < < < <r rr?rYzaccept-encodingrZrrFrzUnable to determine size of %rTzTransfer-EncodingrozContent-Lengthrrt)	frozensetr`rrhr{rXrzrrr1rw)rErtrurrWrIheader_namesskipscontent_lengthrrs           rryzHTTPConnection._send_requests|  < <G < < <<<\!!!"E+,,,-E()--u---<//#,66"'!%!9!9$!G!G!)'?Q..!"BT"IJJJ)-':IFFFNN#3S5H5HIII"N!--//	'	'JCNN3&&&&dC  	)4((D^<<<<<r cX|jr |jrd|_|jtks|jrt	|j|jdkr(||j|j|j}n!||j|j}		|	n##t$r|wxYwt|_|j
r|n||_|S#|xYw)a)Get the response from the server.

        If the HTTPConnection is in the correct state, returns an
        instance of HTTPResponse or of whatever object is returned by
        the response_class variable.

        If a request has not been sent or if a previous response has
        not be handled, ResponseNotReady is raised.  If the HTTP
        response indicates that the connection should be closed, then
        it will be closed before the response is returned.  When the
        connection is closed, the underlying socket is closed.
        Nrr)rrrrvrrhr rsrirConnectionErrorrrrr)rEr's  rgetresponsezHTTPConnection.getresponse>s;?	#t7799	#"DO"<<''4?'"4<000?Q**49do26,+@@HH**49T\*JJH	
    "





$DL"
+

#+O	NNs)B>=D> C3DD))NN)NF)FFr)%rKrLrMrGrVrr 	HTTP_PORTrr7rhstaticmethodrrr
_GLOBAL_DEFAULT_TIMEOUTrvrrrr)r%rrr@rBrLr`rWrTrUr	rXrwr[ryrrr rrrsIM!NLIJ11\1
\>#'0N $;;;;,))))0(   !!!F


!!!&G&G&GP4(4(4(4(l16(-~~~~@''';;;DDDDDD8GeGGGGG)-bG$GGGGG
,=,=,=\=====r rcPeZdZdZeZdddejdfddddfdZfdZ	xZ
S)HTTPSConnectionz(This class allows communication via SSL.Nr)contextcheck_hostnamerc2tt||||||	||| ddl}
|
dt
d||_||_|Btj	}|j
dkr|dg|jd|_|j
tjk}||j}|r|st!d|s|r$||||jd|_||_|||j_dSdS)	N)rrzTkey_file, cert_file and check_hostname are deprecated, use a custom context instead.rxrzhttp/1.1TzMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED)rrrvwarningswarnDeprecationWarningkey_file	cert_filessl_create_default_https_contextrGset_alpn_protocolspost_handshake_authverify_mode	CERT_NONErr~load_cert_chain_context)
rErrrrrrrrrrwill_verifyrs
            rrvzHTTPSConnection.__init__su
/4((11$g2@<E
2
G
G
G$	(=&2

J0!555%DM&DN;==>R''..
|<<<.:26G/!->K%!(!7
Jk
J "IJJJ
79
7''	8<<<.:26G/#DM)/=
,,,*)r ct|jr|j}n|j}|j|j||_dS)z(Connect to a host on a given (SSL) port.)server_hostnameN)rr%rrrwrap_socketrs)rErrs  rr%zHTTPSConnection.connects`
GGOO 
,"&"3"&)
11$)BQ2SSDIIIr )rKrLrM__doc__
HTTPS_PORTrr
rrvr%rrs@rrrs22!'+TT#;$(%	>59$(D%	>%	>%	>%	>%	>%	>%	>N	S	S	S	S	S	S	S	S	Sr rceZdZdS)rNrKrLrMrr rrrs	Dr rceZdZdS)rNrrr rrrDr rceZdZdS)rNrrr rrrrr rceZdZdZdS)rc$|f|_||_dSr)argsrl)rErls  rrvzUnknownProtocol.__init__sH	r NrKrLrMrvrr rrrs#r rceZdZdS)r	Nrrr rr	r	rr r	ceZdZdS)r
Nrrr rr
r
rr r
c*eZdZddZdZejZdS)rNc2|f|_||_||_dSr)rpartialexpected)rErrs   rrvzIncompleteRead.__init__sH	 


r cr|jd|jz}nd}d|jjt|j|fzS)Nz, %i more expectedryz%s(%i bytes read%s))rrrKrArr2s  r__repr__zIncompleteRead.__repr__sE=$$t}4AAA$(?(+DL(9(91(>>	>r r)rKrLrMrvrr+__str__rr rrrs:!!!!>>>nGGGr rceZdZdS)r
Nrrr rr
r
rr r
ceZdZdS)rNrrr rrrrr rceZdZdS)rNrrr rrrrr rceZdZdS)rNrrr rrrrr rceZdZdZdS)rcF|st|}|f|_||_dSr)r|rrIrs  rrvzBadStatusLine.__init__s)	::DE				r Nrrr rrrs#r rceZdZdZdS)rcPt|dt|fzdS)Nz&got more than %d bytes when reading %s)rrvrT)rE	line_types  rrvzLineTooLong.__init__s6t%M(0)'<&=	>	>	>	>	>r Nrrr rrrs#>>>>>r rceZdZdZdS)rcft|dtj|g|Ri|dS)Nry)rrvConnectionResetError)rEposkws   rrvzRemoteDisconnected.__init__s?tR(((%d7S777B77777r Nrrr rrrs#88888r r)r%)Eremail.parserr^
email.messager0r!rrer
r+collections.abcr9urllib.parser__all__rrrkrrSrvglobalsupdater"__members__rrrrTrUcompile	fullmatchrorfrqrlrerr1rr:r(Messager<rXrcBufferedIOBaserrrrrDImportError	Exceptionrrrrr	r
rr
rrrrrrrrrr r<module>rsCDDL								







!!!!!!
	

#		,---
HG$/"="D"D"F"FGGG	6#
#677A%2:&CDDK%/BJ/@$A$A!(2rz-'@'@$322EEEE%%-'<$)@@@@eeeee2$eeeN^	^	^	^	^	^	^	^	@@&JJJ9S9S9S9S9S.9S9S9SvNN$%%%%}			D	@					I			
					=											m
					m								M			]					m								/								.								.			M>>>>>->>>
88888-}888	s+EEE