Your IP : 18.191.205.149


Current Path : /opt/alt/python312/lib64/python3.12/http/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/http/__pycache__/client.cpython-312.opt-2.pyc

�

�Q�f����`�	ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z
ddlmZgd�Z
dZdZdZdZdZd	Ze�j+ej,j.�ej,j.j1�D�cic]}||j2��c}Zd
ZdZej:d�j<Zej:d
�j@Z!ej:d�Z"ej:d�Z#hd�Z$d=d�Z%de&de&fd�Z'Gd�dejPjR�Z*d�Z+e*fd�Z,e*fd�Z-Gd�dej\�Z/d�Z0Gd�d�Z1	ddl2Z2Gd�d e1�Z3e
jid �Gd!�d"e6�Z7Gd#�d$e7�Z8Gd%�d&e7�Z9Gd'�d(e7�Z:Gd)�d*e7�Z;Gd+�d,e7�Z<Gd-�d.e7�Z=Gd/�d0e7�Z>Gd1�d2e>�Z?Gd3�d4e>�Z@Gd5�d6e>�ZAGd7�d8e7�ZBGd9�d:e7�ZCGd;�d<eDeB�ZEe7ZFycc}w#e5$rY��wxYw)>�N)�urlsplit)�HTTPResponse�HTTPConnection�
HTTPException�NotConnected�UnknownProtocol�UnknownTransferEncoding�UnimplementedFileMode�IncompleteRead�
InvalidURL�ImproperConnectionState�CannotSendRequest�CannotSendHeader�ResponseNotReady�
BadStatusLine�LineTooLong�RemoteDisconnected�error�	responses�Pi��UNKNOWN�IdlezRequest-startedzRequest-senti�ds[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]z[-]>�PUT�POST�PATCHc
��		|jd�S#t$rl}t|j|j|j|j
|j
��d||j|j
d�d|�d��d�d}~wwxYw)N�latin-1z (z.20z) is not valid Latin-1. Use z9.encode('utf-8') if you want to send it encoded in UTF-8.)�encode�UnicodeEncodeError�encoding�object�start�end�title)�data�name�errs   �2/opt/alt/python312/lib64/python3.12/http/client.py�_encoder*�s���F�
E��{�{�9�%�%���E� ��L�L��J�J��I�I��G�G��Z�Z�\�4��	�	�#�'�'�2�D�
:�;�AE�	E��E�s��	B	�A'B�B	�enc_name�returnc�@�	|jd�\}}}|r|dz
}|S)N�%�])�	partition)r+�percent�_s   r)�_strip_ipv6_ifacer3�s.��3�#�-�-�d�3��H�g�q���D����O�c��eZdZd�Zy)�HTTPMessagec��	|j�dz}t|�}g}d}|j�D]D}|d|j�|k(rd}n|ddj�sd}|s�4|j	|��F|S)N�:r�)�lower�len�keys�isspace�append)�selfr'�n�lst�hit�lines      r)�getallmatchingheadersz!HTTPMessage.getallmatchingheaders�s���	��z�z�|�c�!����I�������I�I�K�D��B�Q�x�~�~��4�'����"�1�X�%�%�'�����
�
�4� �
 ��
r4N)�__name__�
__module__�__qualname__rD�r4r)r6r6�s��r4r6c���	g}	|jtdz�}t|�tkDrtd��|j	|�t|�t
kDrt
dt
z��|dvr	|S�r)Nr9zheader linezgot more than %d headers��
�
r4)�readline�_MAXLINEr;rr>�_MAXHEADERSr)�fp�headersrCs   r)�
_read_headersrR�sy���
�G�
��{�{�8�a�<�(���t�9�x���m�,�,����t���w�<�+�%�� :�[� H�I�I��(�(���N�r4c��	dj|�jd�}tjj	|��j|�S)Nr4�
iso-8859-1)�_class)�join�decode�email�parser�Parser�parsestr)�header_linesrU�hstrings   r)�_parse_header_linesr^�sE��	��h�h�|�$�+�+�L�9�G��<�<���f��-�6�6�w�?�?r4c�2�	t|�}t||�S�N)rRr^)rPrUrQs   r)�
parse_headersra�s��:��B��G��w��/�/r4c����eZdZdd�Zd�Zd�Zd�Zd�Z�fd�Z�fd�Z	d�Z
d	�Zd d
�Zd�Z
d�Zd
�Zd�Zd d�Zd�Zd�Zd�Zd!d�Zd!d�Zd!�fd�	Zd�Zd�Zd�Zd d�Zd�Zd�Zd�Zd�Zd�Z �xZ!S)"rc��|jd�|_||_||_dx|_|_t|_t|_t|_	t|_
t|_t|_t|_
y)N�rb)�makefilerP�
debuglevel�_methodrQ�msg�_UNKNOWN�version�status�reason�chunked�
chunk_left�length�
will_close)r?�sockrf�method�urls     r)�__init__zHTTPResponse.__init__se���-�-��%���$������#'�&���t�x� ������������"������"��r4c�l�t|jjtdz�d�}t	|�tkDrtd��|jdkDrtdt|��|std��	|jdd�\}}}|jd	�s|j�t|��	t�}|d
ks|dkDrt|��	||fS#t$r-	|jdd�\}}d}n#t$rd}YnwxYwY��wxYw#t$rt|��wxYw)Nr9rTzstatus linerzreply:z-Remote end closed connection without response��zHTTP/ri�)�strrPrMrNr;rrf�print�reprr�split�
ValueError�
startswith�_close_connr�int)r?rCrjrkrls     r)�_read_statuszHTTPResponse._read_status#sD���4�7�7�#�#�H�q�L�1�<�@���t�9�x���m�,�,��?�?�Q���(�D��J�'��%�&1�2�
2�	�&*�j�j��q�&9�#�G�V�V��!�!�'�*�������%�%�	&���[�F���|�v��|�#�D�)�)� ,����&�&��%�	�
�"&�*�*�T�1�"5��������
���
��		�� �	&���%�%�	&�sB�<C%�? D�%	D�/D�D�D�D�D�D�D�D3c��|j�y	|j�\}}}|tk7rn2t|j�}|j
dkDrt
d|�~�P|x|_|_|j�|_
|dvrd|_n$|jd�rd|_nt|��t|j�x|_|_|j
dkDr2|jj!�D]\}}t
d|d	z|��|jj#d
�}|r"|j%�dk(rd|_d|_nd|_|j+�|_d|_|jj#d
�}|r4|j&s(	t1|�|_|j.dkrd|_nd|_|t4k(s%|t6k(sd|cxkrdksn|j8dk(rd|_|j,s"|j&s|j.�d|_yyyy#t2$r
d|_Y�vwxYw)NTrzheaders:)zHTTP/1.0zHTTP/0.9�
zHTTP/1.��header:r8�transfer-encodingrmF�content-lengthr���HEAD)rQr��CONTINUErRrPrfry�coderk�striprlrjr}rrarh�items�getr:rmrn�_check_closerprorr|�
NO_CONTENT�NOT_MODIFIEDrg)	r?rjrkrl�skipped_headers�hdr�val�tr_encros	         r)�beginzHTTPResponse.beginDs���<�<�#���&*�&7�&7�&9�#�G�V�V���!��+�D�G�G�4�O�����"��j�/�2���#)�(��	�D�K��l�l�n����.�.��D�L�
�
�
�	�
*��D�L�!�'�*�*�"/����"8�8���t�x��?�?�Q�� �L�L�.�.�0���S��i��s��C�0�1����!�!�"5�6���f�l�l�n�	�1��D�L�"�D�O� �D�L��+�+�-���������!�!�"2�3���$�,�,�
'�!�&�k����;�;��?�"&�D�K��D�K�
�j� �F�l�$:��6��C���L�L�F�"��D�K�
�������K�K��"�D�O�
 �� ��#�
#�"���
#�s� H2�2I�Ic�F�|jjd�}|jdk(r|rd|j�vryy|jjd�ry|rd|j�vry|jjd�}|rd|j�vryy)N�
connectionr��closeTFz
keep-alivezproxy-connection)rQr�rjr:)r?�conn�pconns   r)r�zHTTPResponse._check_close�s����|�|����-���<�<�2����4�:�:�<�/����<�<���L�)���L�D�J�J�L�0����� � �!3�4���\�U�[�[�]�2��r4c�J�|j}d|_|j�yr`)rPr�)r?rPs  r)r~zHTTPResponse._close_conn�s��
�W�W�����
���
r4c���	t�|��|jr|j�yy#|jr|j�wwxYwr`)�superr�rPr~�r?�	__class__s �r)r�zHTTPResponse.close�sB���	#��G�M�O��w�w�� � �"���t�w�w�� � �"��s	�/�Ac�p��t�|��|jr|jj�yyr`)r��flushrPr�s �r)r�zHTTPResponse.flush�s%���
��
���7�7��G�G�M�M�O�r4c��	y)NTrH�r?s r)�readablezHTTPResponse.readable�s��!�r4c� �	|jduSr`)rPr�s r)�isclosedzHTTPResponse.isclosed�s��/��w�w�$��r4c���	|j�y|jdk(r|j�y|jr|j	|�S|��|j
�||j
kDr|j
}|jj
|�}|s|r|j�|S|j
�:|xj
t|�zc_|j
s|j�|S|j
�|jj
�}n#	|j|j
�}d|_|j�|S#t$r|j��wxYw)Nr4r�r)
rPrgr~rm�
_read_chunkedro�readr;�
_safe_readr)r?�amt�ss   r)r�zHTTPResponse.read�s5��M��7�7�?���<�<�6�!�������<�<��%�%�c�*�*��?��{�{�&�3����+<��k�k�������S�!�A���� � �"�
�H�	���(����s�1�v�%���{�{��$�$�&��H��{�{�"��G�G�L�L�N���������4�A� ��������H��&���$�$�&���s�E
�
E%c���	|j�y|jdk(r|j�y|jr|j	|�S|j
�0t
|�|j
kDrt|�d|j
}|jj|�}|s|r|j�|S|j
�1|xj
|zc_|j
s|j�|S)Nrr�)	rPrgr~rm�_readinto_chunkedror;�
memoryview�readinto)r?�br@s   r)r�zHTTPResponse.readinto�s���	��7�7�?���<�<�6�!�������<�<��)�)�!�,�,��;�;�"��1�v����#��q�M�!�D�K�K�0��

�G�G���Q����Q�
����
��	�[�[�
$��K�K�1��K��;�;�� � �"��r4c��|jjtdz�}t|�tkDrt	d��|jd�}|dk\r|d|}	t
|d�S#t$r|j��wxYw)Nr9z
chunk size�;r�)	rPrMrNr;r�findrr|r~)r?rC�is   r)�_read_next_chunk_sizez"HTTPResponse._read_next_chunk_sizes����w�w����1��-���t�9�x���l�+�+��I�I�d�O����6����8�D�	��t�R�=� ���	�
�����		�s�A(�(Bc��	|jjtdz�}t|�tkDrt	d��|sy|dvry�H)Nr9ztrailer linerJ)rPrMrNr;r�r?rCs  r)�_read_and_discard_trailerz&HTTPResponse._read_and_discard_trailer)sO����7�7�#�#�H�q�L�1�D��4�y�8�#�!�.�1�1����,�,��r4c��|j}|sR|�|jd�	|j�}|dk(r"|j�|j
�d}||_|S#t$rt	d��wxYw)Nrvr4r)rnr�r�r|rr�r~)r?rns  r)�_get_chunk_leftzHTTPResponse._get_chunk_left7s����_�_�
���%�����"�
*�!�7�7�9�
��Q���.�.�0�� � �"�!�
�(�D�O�����
*�$�S�)�)�
*�s�A#�#A8c��g}	|j�x}�s|�0||kr+|j|j|��||z
|_nA|j|j|��|�||z}d|_|j�x}��sdj	|�S#t
$r }tdj	|��|�d}~wwxYw�Nrr4)r�r>r�rnrVr)r?r��valuern�excs     r)r�zHTTPResponse._read_chunkedOs�����
	;�!%�!5�!5�!7�7�:�D��?�s�j�'8��L�L�����!5�6�&0�3�&6�D�O�����T�_�_�Z�8�9��?��:�%�C�"#���"&�!5�!5�!7�7�:�D��8�8�E�?�"���	;� ����%��1�s�:��	;�s�BB�	B�	C�#B>�>Cc�<�d}t|�}		|j�}|�|St|�|kr |j|�}||z
|_||zS|d|}|j|�}||d}||z
}d|_�j#t
$rtt
|d|���wxYw)Nr)r�r�r;�_safe_readintornr�bytes)r?r��total_bytes�mvbrnr@�temp_mvbs       r)r�zHTTPResponse._readinto_chunkedas�������m��	:��!�1�1�3�
��%�&�&��s�8�z�)��+�+�C�0�A�&0�1�n�D�O�&��?�*��{�
�+���'�'��1���!�"�g���q� ��"#����� �	:� ��q��;�'7�!8�9�9�	:�s�A:�-A:�(A:�:!Bc��	|jj|�}t|�|krt||t|�z
��|Sr`)rPr�r;r)r?r�r&s   r)r�zHTTPResponse._safe_readys@��	��w�w�|�|�C� ���t�9�s�?� ��s�3�t�9�}�5�5��r4c��	t|�}|jj|�}||krtt	|d|�||z
��|Sr`)r;rPr�rr�)r?r�r�r@s    r)r�zHTTPResponse._safe_readinto�sI��@��!�f���G�G���Q����s�7� ��q��!�u��s�1�u�5�5��r4c��	|j�|jdk(ry|jr|j|�S|j� |dks||jkDr|j}|jj|�}|s|r|j
�|S|j�:|xjt|�zc_|js|j
�|S�Nr�r4r)rPrgrm�_read1_chunkedro�read1r~r;)r?r@�results   r)r�zHTTPResponse.read1�s���	��7�7�?�d�l�l�f�4���<�<��&�&�q�)�)��;�;�"��A���T�[�[�����A������q�!���!�����
�
�	�[�[�
$��K�K�3�v�;�&�K��;�;�� � �"��
r4c��|j�|jdk(ry|jr|j|�S|jj	|�S)Nr�r4)rPrgrm�
_peek_chunked�peek)r?r@s  r)r�zHTTPResponse.peek�sE���7�7�?�d�l�l�f�4���<�<��%�%�a�(�(��w�w�|�|�A��r4c���|j�|jdk(ry|jrt�|�|�S|j
� |dks||j
kDr|j
}|jj	|�}|s|r|j
�|S|j
�:|xj
t|�zc_|j
s|j
�|Sr�)rPrgrmr�rMror~r;)r?�limitr�r�s   �r)rMzHTTPResponse.readline�s�����7�7�?�d�l�l�f�4���<�<��7�#�E�*�*��;�;�"���	�U�T�[�[�5H��K�K�E����!�!�%�(���%�����
�
�	�[�[�
$��K�K�3�v�;�&�K��;�;�� � �"��
r4c���|j�}|�|dk(ryd|cxkr|ksn|}|jj|�}|xjt	|�zc_|std��|Sr�)r�rPr�rnr;r)r?r@rnr�s    r)r�zHTTPResponse._read1_chunked�sj���)�)�+�
����a����Q�$�*�$��A��w�w�}�}�Q������3�t�9�$��� ��%�%��r4c��	|j�}|�y|jj|�d|S#t$rYywxYw)Nr4)r�rrPr�)r?r@rns   r)r�zHTTPResponse._peek_chunked�sP��	��-�-�/�J�����w�w�|�|�J�'���4�4��
�	��	�s�3�	?�?c�6�|jj�Sr`)rP�filenor�s r)r�zHTTPResponse.fileno�s���w�w�~�~��r4c���	|j�
t��|jj|�xs|}t|t�st|d�s|Sdj
|�S)N�__iter__z, )rQr�get_all�
isinstancerx�hasattrrV)r?r'�defaultrQs    r)�	getheaderzHTTPResponse.getheader�s\��
	��<�<��"�$�$��,�,�&�&�t�,�7����g�s�#�7�7�J�+G��N��9�9�W�%�%r4c�v�	|j�
t��t|jj��Sr`)rQr�listr�r�s r)�
getheaderszHTTPResponse.getheaders�s0��4��<�<��"�$�$��D�L�L�&�&�(�)�)r4c��|Sr`rHr�s r)r�zHTTPResponse.__iter__�s���r4c��	|jSr`)rQr�s r)�infozHTTPResponse.info�s��	�(�|�|�r4c��	|jSr`)rsr�s r)�geturlzHTTPResponse.geturls��	��x�x�r4c��	|jSr`)rkr�s r)�getcodezHTTPResponse.getcodes��	��{�{�r4)rNNr`)���)"rErFrGrtr�r�r�r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rMr�r�r�r�r�r�r�r�r��
__classcell__�r�s@r)rr�s����#�<'�BF#�P�:�
#��
��&�P �D� ��0;�$:�0
���&��"�5� �&�(*��
�.
�r4rc��tj�}|dk(r|jdg�|j�d|_|S)Nr�zhttp/1.1T)�ssl�_create_default_https_context�set_alpn_protocols�post_handshake_auth)�http_version�contexts  r)�_create_https_contextr�$sC���/�/�1�G��r���"�"�J�<�0��"�"�.�&*��#��Nr4c�
�eZdZdZdZeZeZdZ	dZ
ed��Zed��Z
dejddfd	�Zd"d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd#d�Z		d$d�Zd�Zd�Zd�Z d�Z!d�Z"d%dd�d�Z#difdd�d�Z$d �Z%d!�Z&y)&rr�zHTTP/1.1r9rc�8�	t|tj�Sr`)r��io�
TextIOBase)�streams r)�
_is_textIOzHTTPConnection._is_textIO;s��	��&�"�-�-�0�0r4c���	|�|j�tvryyt|d�ry	t|�}|jS#t
$rYnwxYwt
|t�rt|�Sy)Nrr�)	�upper�_METHODS_EXPECTING_BODYr�r��nbytes�	TypeErrorr�rxr;)�bodyrr�mvs   r)�_get_content_lengthz"HTTPConnection._get_content_lengthAsv��	��<��|�|�~�!8�8����4�� ��	��D�!�B��9�9����	��	���d�C� ��t�9��s�A�	A
�A
N� c�R�||_||_||_d|_g|_d|_t|_d|_d|_	d|_
i|_d|_|j||�\|_|_|j!|j�t"j$|_yr`)�timeout�source_address�	blocksizerq�_buffer�_HTTPConnection__response�_CS_IDLE�_HTTPConnection__staterg�_tunnel_host�_tunnel_port�_tunnel_headers�_raw_proxy_headers�
_get_hostport�host�port�_validate_host�socket�create_connection�_create_connection)r?rrrrrs      r)rtzHTTPConnection.__init__as������,���"�����	������������� ��� ���!���"&���!%�!3�!3�D�$�!?����D�I����D�I�I�&�#)�":�":��r4c��	|jrtd��|j||�\|_|_|r|j�|_n|jj�td�|jD��sI|jjd�jd�}d||jfz|jd<yy)Nz.Can't set up tunnel for established connectionc3�BK�|]}|j�dk(���y�w)rN�r:)�.0�headers  r)�	<genexpr>z,HTTPConnection.set_tunnel.<locals>.<genexpr>�s����O�:N��6�<�<�>�V�+�:N�s��idna�asciiz%s:%d�Host)rq�RuntimeErrorrr
r�copyr�clear�anyrrW)r?rrrQ�encoded_hosts     r)�
set_tunnelzHTTPConnection.set_tunnelxs���	�*�9�9��O�P�P�/3�/A�/A�$��/M�,���4�,��#*�<�<�>�D� �� � �&�&�(��O�$�:N�:N�O�O��,�,�3�3�F�;�B�B�7�K�L�+2��d�/�/�61�,1�D� � ��(�Pr4c�H�|�K|jd�}|jd�}||kDr	t||dzd�}|d|}n|j}|r|ddk(r
|ddk(r|dd}||fS#t$r/||dzddk(r
|j}nt	d||dzdz��Y�dwxYw)	Nr8�]r9rwznonnumeric port: '%s'r�[r�)�rfindrr|�default_portr)r?rrr��js     r)rzHTTPConnection._get_hostport�s����<��
�
�3��A��
�
�3��A��1�u�O��t�A�a�C�D�z�?�D��B�Q�x���(�(���D��G�s�N�t�B�x�3����"�:�D��d�|���"�O��A�a�C�D�z�R�'�#�0�0��(�)@�4��!���:�)M�N�N��O�s�A)�)5B!� B!c��||_yr`)rf)r?�levels  r)�set_debuglevelzHTTPConnection.set_debuglevel�s	����r4c�.�d|vr|ddk7rd|zdzS|S)N�:r�[�[r/rH)r?�ips  r)�
_wrap_ipv6zHTTPConnection._wrap_ipv6�s(���2�:�"�Q�%�7�*��"�9�t�#�#��	r4c��d|j|jjd��|j|jjd�fz}|g}|j
j
�D]+\}}|j|�d|�d�jd���-|jd�|jdj|��~|j|j|j�	�}	|j�\}}}t|j�|_|j"d
kDr+|j D]}t%d|j'���|t(j*j,k7r/|j/�t1d|�d
|j3�����	|j/�y#|j/�wxYw)NsCONNECT %s:%d %s
rrz: �
rrKr4�rrrr�zTunnel connection failed: � )r2r
rr�
_http_vsn_strrr�r>�sendrV�response_classrqrgr�rRrPr
rfryrW�http�
HTTPStatus�OKr��OSErrorr�)	r?�connectrQrr��responserjr��messages	         r)�_tunnelzHTTPConnection._tunnel�s���)��O�O�D�-�-�4�4�V�<�=�������%�%�g�.�-0�0���)��!�1�1�7�7�9�M�F�E��N�N�f�X�R��w�d�3�:�:�9�E�F�:����w��	
�	�	�#�(�(�7�#�$���&�&�t�y�y����&�F��	�'/�'<�'<�'>�$�W�d�G�&3�H�K�K�&@�D�#�����"�"�5�5�F��)�V�]�]�_�5�6��t���)�)�)��
�
��� :�4�&��'�-�-�/�AR�S�T�T�*�

�N�N���H�N�N��s
�9B4F?�?Gc�J�	|j�t|j�SdSr`)r
r^r�s r)�get_proxy_response_headersz)HTTPConnection.get_proxy_response_headers�s4��	��&�&�2�
 �� 7� 7�8�	
��	
r4c��	tjd||j|j�|j	|j|jf|j
|j�|_	|jjtjtjd�|jr|j!�yy#t$r(}|jtjk7r�Yd}~�Jd}~wwxYw)Nzhttp.client.connectr9)�sys�auditrrrrrrq�
setsockoptr�IPPROTO_TCP�TCP_NODELAYr=�errno�ENOPROTOOPTr
rA�r?�es  r)r>zHTTPConnection.connect�s���A��	�	�'��t�y�y�$�)�)�D��+�+�
�Y�Y�t�y�y�!�4�<�<��1D�1D�F��	�	��I�I� � ��!3�!3�V�5G�5G��K�
����L�L�N���	�	��w�w�%�+�+�+��,��	�s�19C�	C9�C4�4C9c�
�	t|_	|j}|rd|_|j�|j}|rd|_|j�yy#|j}|rd|_|j�wwxYwr`)rr	rqr�r)r?rqr?s   r)r�zHTTPConnection.close�su��6����		!��9�9�D�� ��	��
�
�����H��"&������ ������H��"&������ ��s�%A�(Bc��	|j�'|jr|j�n
t��|jdkDrtdt
|��t|d�r�|jdkDrtd�|j|�}|r|jdkDrtd�|j|j�x}rc|r|jd�}tjd||�|jj|�|j|j�x}r�cytjd||�	|jj|�y#t$r`t!|t"j$j&�r$|D]}|jj|��Yytdt)|�z��wxYw)	Nrzsend:r�zsending a readable�encoding file using iso-8859-1rTzhttp.client.sendz9data should be a bytes-like object or an iterable, got %r)rq�	auto_openr>rrfryrzr�r�r�rrrErF�sendallr�r��collections�abc�Iterable�type)r?r&r�	datablock�ds     r)r8zHTTPConnection.sends���	�
�9�9���~�~�����"�n�$��?�?�Q���'�4��:�&��4�� �����"��*�+��_�_�T�*�F��$�/�/�A�-��6�7�#�y�y����8�8�)�8�� )� 0� 0�� >�I��	�	�,�d�I�>��	�	�!�!�)�,�	 $�y�y����8�8�)�8�

��	�	�$�d�D�1�	G��I�I���d�#���	G��$���� 8� 8�9��A��I�I�%�%�a�(�� �!9�;?��:�!F�G�G�	G�s�E!�!AG
�2G
c�<�	|jj|�yr`)rr>)r?r�s  r)�_outputzHTTPConnection._output(s��	�	
�����A�r4c#�@K�|jdkDrtd�|j|�}|r|jdkDrtd�|j|j�x}r6|r|jd�}|��|j|j�x}r�5yy�w)Nrzreading a readablerPrT)rfryr�r�rr)r?r�rrWs    r)�_read_readablezHTTPConnection._read_readable/s������?�?�Q���&�'�����*���d�o�o��)��2�3�#�=�=����8�8�i�8��%�,�,�\�:�	��O�$�=�=����8�8�i�8�s�BB�BFc��	|jjd�dj|j�}|jdd�=|j|�|��t	|d�r|j|�}n	t
|�|f}|D]e}|s|jdkDrtd�� |r3|jdk(r$t|�d�d	�jd
�|zdz}|j|��g|r"|jdk(r|jd�yyyy#t$r4	t|�}n$#t$rtdt|�z��wxYwY��wxYw)N)r4r4rKr�zAmessage_body should be a bytes-like object or an iterable, got %rrzZero length chunk ignoredr��Xr4rs0

)r�extendrVr8r�r\r�r��iterrVrfry�	_http_vsnr;r)r?�message_body�encode_chunkedrh�chunks�chunks      r)�_send_outputzHTTPConnection._send_output:se��	�
	
�����J�'��l�l�4�<�<�(���L�L��O��	�	�#���#��|�V�,��,�,�\�:��-�
�|�,�+�_�F��������*��9�:��!�d�n�n��&:�"�5�z�!�n�D�1�8�8��A�E�I�!�"�E��	�	�%� � ��$�.�.�B�"6��	�	�,�'�#7�~�O$��!�>�>�!%�l�!3���$�>�'�)H�*.�|�*<�)=�>�>�>���>�s*�9D�	E�!D-�,E�-!E�E�Ec�|�	|jr!|jj�rd|_|jtk(rt|_nt|j��|j
|�||_|xsd}|j|�|�d|�d|j��}|j|j|��|jdk(�r&|�s
d}|jd�rt|�\}}}}}|r.	|jd�}|j#dt%|��n�|j&r|j&}	|j(}
n|j*}	|j,}
	|	jd�}|j/|�}d	|	vrt%|�}|
|j0k(r|j#d|�n(|j3d�}|j#d|�d	|
���|s|j#d
d�yyy#t $r|jd�}Y��	wxYw#t $r|	jd�}Y��wxYw)N�/r6r�rwr:rrrr8zAccept-Encoding�identity)rr�r	r�_CS_REQ_STARTEDr�_validate_methodrg�_validate_pathr7rZ�_encode_requestrar}rrr �	putheaderr3r
rrrr2r(rW)r?rrrs�	skip_host�skip_accept_encoding�request�netloc�nil�
netloc_encrr�host_encs            r)�
putrequestzHTTPConnection.putrequestps��	��?�?�t���7�7�9�"�D�O�*�<�<�8�#�*�D�L�#�D�L�L�1�1����f�%�����j�S�����C� � &��T�-?�-?�@�����T�)�)�'�2�3��>�>�R������>�>�&�)�19�#��.�C���c�3��;�%+�]�]�7�%;�
��N�N�6�+<�Z�+H�I��(�(�#�0�0��#�0�0��#�y�y��#�y�y��7�#'�;�;�w�#7�� $���x�8�H��d�{�#4�X�#>���t�0�0�0����v�x�8�#+�?�?�7�#;�����v�(�D�/I�J�(����0�*�=�(�
��c.�;�%+�]�]�6�%:�
�;��.�7�#'�;�;�v�#6��7�s$�G=�+H�=H�H�H;�:H;c�$�|jd�S)Nr)r)r?rqs  r)rmzHTTPConnection._encode_request�s���~�~�g�&�&r4c�t�	tj|�}|r td|�d|j��d���y)Nz)method can't contain control characters. � (found at least �))�$_contains_disallowed_method_pchar_re�searchr|�group)r?rr�matchs   r)rkzHTTPConnection._validate_method�sJ��4�4�;�;�F�C����?��z�J'�',�{�{�}�&7�q�:�;�
;�r4c�t�	tj|�}|r td|�d|j��d���y�Nz&URL can't contain control characters. ryrz��!_contains_disallowed_url_pchar_rer|rr})r?rsr~s   r)rlzHTTPConnection._validate_path�sM��,�1�8�8��=����E�c�W�M0�05���
�/@��C�D�
D�r4c�t�	tj|�}|r td|�d|j��d���yr�r�)r?rr~s   r)rzHTTPConnection._validate_hostsM��G�1�8�8��>����E�d�X�N0�05���
�/@��C�D�
D�r4c��	|jtk7r
t��t|d�r|j	d�}t|�st
d|����t|�}t|�D]r\}}t|d�r|j	d�||<n-t|t�rt|�j	d�||<t||�s�ct
d||����dj|�}|dz|z}|j|�y)NrrzInvalid header name rzInvalid header value s
	s: )r	rjrr�r�_is_legal_header_namer|r��	enumerater�rrx�_is_illegal_header_valuerVrZ)r?r�valuesr��	one_valuer�s      r)rnzHTTPConnection.putheaders���	��<�<�?�*�"�$�$��6�8�$��]�]�7�+�F�$�V�,���A�B�B��f���%�f�-�L�A�y��y�(�+�%�,�,�Y�7��q�	��I�s�+��	�N�1�1�'�:��q�	�'��q�	�2� �f�Q�i�!I�J�J�.����v�&���%��%�'�����V�r4�rcc�~�	|jtk(rt|_n
t��|j	||��y)Nr�)r	rj�_CS_REQ_SENTrrf)r?rbrcs   r)�
endheaderszHTTPConnection.endheaders(s8��	��<�<�?�*�'�D�L�"�$�$����,�~��Fr4c�0�	|j|||||�yr`)�
_send_request)r?rrrsr�rQrcs      r)rqzHTTPConnection.request5s��4����6�3��g�~�Fr4c�
�td�|D��}i}d|vrd|d<d|vrd|d<|j||fi|��d|vrjd|vrhd	}|j||�}|�4|�P|jd
kDrt	d|z�d}|jd
d�n|jdt
|��nd	}|j�D]\}	}
|j|	|
��t|t�rt|d�}|j||��y)Nc3�<K�|]}|j����y�wr`r)r�ks  r)rz/HTTPConnection._send_request.<locals>.<genexpr><s���� <�G�q�����G�s�rr9rozaccept-encodingrpr�r�FrzUnable to determine size of %rTzTransfer-EncodingrmzContent-Lengthr�r�)�	frozensetrvrrfryrnrxr�r�r*r�)r?rrrsr�rQrc�header_names�skips�content_lengthr�r�s           r)r�zHTTPConnection._send_request:s�� � <�G� <�<�����\�!�!"�E�+����,�,-�E�(�)�������-�u�-��<�/�#�,�6�"'��!%�!9�!9�$��!G��!�)��'��?�?�Q�.�!�"B�T�"I�J�)-�����':�I�F��N�N�#3�S��5H�I�"�N�!�-�-�/�J�C���N�N�3��&�*��d�C� ��4��(�D�����^��<r4c��	|jr!|jj�rd|_|jtk7s|jrt	|j��|j
dkDr3|j
|j|j
|j��}n'|j
|j|j��}		|j�t|_|jr|j�|S||_|S#t$r|j��wxYw#|j��xYw)Nrr5)rr�r	r�rrfr9rqrgr��ConnectionErrorr�rrp)r?r?s  r)�getresponsezHTTPConnection.getresponsehs��	��?�?�t���7�7�9�"�D�O�"�<�<�<�'�4�?�?�"�4�<�<�0�0��?�?�Q���*�*�4�9�9�d�o�o�26�,�,�+�@�H��*�*�4�9�9�T�\�\�*�J�H�	�
���� �
$�D�L��"�"��
�
��
�O�#+����O��#�
��
�
���
��	��N�N���s$�D�(D.�D.�D+�+D.�.E)NN)NF)FFr`)'rErFrGrar7rr9�	HTTP_PORTr(rQrf�staticmethodr�rr�_GLOBAL_DEFAULT_TIMEOUTrtr#rr,r2rArCr>r�r8rZr\rfrvrmrkrlrrnr�rqr�r�rHr4r)rr1s����I��M�!�N��L��I��J��1��1�
����>#'��0N�0N� $��;�."1�H�( ��
�@
�
�!�#G�J�	�4(�l16�(-�}�~'�;�D�D��8G�e�G�)-�b�G�$�G�
,=�\=r4rc�P��eZdZ	eZdejdddd��fd�Z�fd�Z�xZ	S)�HTTPSConnectionNr)rrr�rc�r��tt|�|||||��|�t|j�}||_y)N)r)r�r�rtr�ra�_context)r?rrrrr�rr�s       �r)rtzHTTPSConnection.__init__�sB���
�/�4�1�$��g�2@�<E�
2�
G���/����?��#�D�Mr4c����	t�|��|jr
|j}n|j}|jj|j|��|_y)N)�server_hostname)r�r>r
rr��wrap_socketrq)r?r�r�s  �r)r>zHTTPSConnection.connect�sR���6��G�O��� � �"&�"3�"3��"&�)�)���
�
�1�1�$�)�)�BQ�2�S�D�Ir4r`)
rErFrG�
HTTPS_PORTr(rr�rtr>r�r�s@r)r�r��s1���2�!��	$� &� >� >�$(�$�$�	$�	S�	Sr4r�c��eZdZy)rN�rErFrGrHr4r)rr�s��	r4rc��eZdZy)rNr�rHr4r)rr����r4rc��eZdZy)rNr�rHr4r)rr�r�r4rc��eZdZd�Zy)rc�"�|f|_||_yr`)�argsrj)r?rjs  r)rtzUnknownProtocol.__init__�s���H��	���r4N�rErFrGrtrHr4r)rr�s��r4rc��eZdZy)r	Nr�rHr4r)r	r	�r�r4r	c��eZdZy)r
Nr�rHr4r)r
r
�r�r4r
c�2�eZdZdd�Zd�ZejZy)rNc�0�|f|_||_||_yr`)r��partial�expected)r?r�r�s   r)rtzIncompleteRead.__init__�s���H��	���� ��
r4c��|j�d|jz}nd}d|jjt|j�|fzS)Nz, %i more expectedrwz%s(%i bytes read%s))r�r�rEr;r�rLs  r)�__repr__zIncompleteRead.__repr__�sK���=�=�$�$�t�}�}�4�A��A�$����(?�(?�(+�D�L�L�(9�1�(>�>�	>r4r`)rErFrGrtr�r"�__str__rHr4r)rr�s��!�>��n�n�Gr4rc��eZdZy)r
Nr�rHr4r)r
r
�r�r4r
c��eZdZy)rNr�rHr4r)rr�r�r4rc��eZdZy)rNr�rHr4r)rr�r�r4rc��eZdZy)rNr�rHr4r)rr�r�r4rc��eZdZd�Zy)rc�<�|st|�}|f|_||_yr`)rzr�rCr�s  r)rtzBadStatusLine.__init__�s�����:�D��E��	���	r4Nr�rHr4r)rr�s��r4rc��eZdZd�Zy)rc�B�tj|dt|fz�y)Nz&got more than %d bytes when reading %s)rrtrN)r?�	line_types  r)rtzLineTooLong.__init__s"�����t�%M�(0�)�'<�&=�	>r4Nr�rHr4r)rrs��>r4rc��eZdZd�Zy)rc�b�tj|d�tj|g|��i|��y)Nrw)rrt�ConnectionResetError)r?�pos�kws   r)rtzRemoteDisconnected.__init__s*�����t�R�(��%�%�d�7�S�7�B�7r4Nr�rHr4r)rrs��8r4r)r&)G�email.parserrX�
email.messagerJr:r��rerrE�collections.abcrS�urllib.parser�__all__r�r�rirrjr��globals�updater;�__members__r��phraserrNrO�compile�	fullmatchr�r|r�r�r{r�r*r�r3r@�Messager6rRr^ra�BufferedIOBaserr�rr�r�r>�ImportError�	Exceptionrrrrr	r
rr
rrrrrr�rr)�vs0r)�<module>r�sw��D�L����	�	�
�
��!���
�	�
�
�����#�����	������,�,�-�#'�/�/�"=�"=�"D�"D�"F�G�"F�Q�Q����[�"F�G�	�����6#��
�
�#6�7�A�A��%�2�:�:�&C�D�K�K��%/�B�J�J�/@�$A�!�(2�r�z�z�-�'@�$�3��E����%���%�-�-�'�'��<�$.9�@�)�0�e�2�$�$�e�P
�t	�t	�l!&��S�.�S�8�N�N�$�%�	�I�	�
	�=�	�	��	��m��
	�m�	�	�M�	��]��	�m�	�	�/�	�	�.�	�	�.�	��M��>�-�>�
8�-�}�8�	���A-
H��z)�	��	�s�H �"H%�%H-�,H-

?>