AlkantarClanX12

Your IP : 3.144.109.159


Current Path : /opt/alt/python311/lib64/python3.11/http/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/http/__pycache__/client.cpython-311.opt-2.pyc

�

c��f����L�	ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z
ddlmZgd�Z
dZdZdZdZdZd	Ze���ejj��d
�ejj���D��ZdZdZejd
��jZejd��jZ ejd��Z!ejd��Z"hd�Z#d=d�Z$de%de%fd�Z&Gd�dej'j(��Z)d�Z*e)fd�Z+Gd�dej,��Z-Gd�d��Z.	ddl/Z/Gd�d e.��Z0e
�1d ��n#e2$rYnwxYwGd!�d"e3��Z4Gd#�d$e4��Z5Gd%�d&e4��Z6Gd'�d(e4��Z7Gd)�d*e4��Z8Gd+�d,e4��Z9Gd-�d.e4��Z:Gd/�d0e4��Z;Gd1�d2e;��Z<Gd3�d4e;��Z=Gd5�d6e;��Z>Gd7�d8e4��Z?Gd9�d:e4��Z@Gd;�d<eAe?��ZBe4ZCdS)>�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-sentc��i|]
}||j��S�)�phrase)�.0�vs  �2/opt/alt/python311/lib64/python3.11/http/client.py�
<dictcomp>rls��G�G�G�Q�Q���G�G�G�i�ds[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]z[-]>�PUT�POST�PATCH�datac
��		|�d��S#t$r[}t|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)r%�name�errs   r�_encoder1�s���F�
E��{�{�9�%�%�%���E�E�E� ��L��J��I��G��Z�Z�\�\�\�\�4��	�#�'� 1�2�2�2�2�D�D�D�
:�;�;�AE�	E�����E���s��
A=�AA8�8A=�enc_name�returnc�H�	|�d��\}}}|r|dz
}|S)N�%�])�	partition)r2�percent�_s   r�_strip_ipv6_ifacer:�s6��3�#�-�-�d�3�3��H�g�q����D����Or c��eZdZd�ZdS)�HTTPMessagec�:�	|���dz}t|��}g}d}|���D]Z}|d|����|krd}n|dd����sd}|r|�|���[|S)N�:r�)�lower�len�keys�isspace�append)�selfr/�n�lst�hit�lines      r�getallmatchingheadersz!HTTPMessage.getallmatchingheaders�s���	��z�z�|�|�c�!����I�I�������I�I�K�K�	!�	!�D��B�Q�B�x�~�~���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)NTr?�header linezgot more than %d headers��
�
r )�readline�_MAXLINErArrD�_MAXHEADERSr)�fp�headersrIs   r�
_read_headersrX�s����
�G���{�{�8�a�<�(�(���t�9�9�x����m�,�,�,����t�����w�<�<�+�%�%�� :�[� H�I�I�I��(�(�(����Nr c���	t|��}d�|���d��}tj�|����|��S)Nr �
iso-8859-1)�_class)rX�join�decode�email�parser�Parser�parsestr)rVr[rW�hstrings    r�
parse_headersrc�s\����B���G��h�h�w���&�&�|�4�4�G��<���f��-�-�6�6�w�?�?�?r c����eZdZd"d�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)%rrNc��|�d��|_||_||_dx|_|_t|_t|_t|_	t|_
t|_t|_t|_
dS)N�rb)�makefilerV�
debuglevel�_methodrW�msg�_UNKNOWN�version�status�reason�chunked�
chunk_left�length�
will_close)rE�sockrh�method�urls     r�__init__zHTTPResponse.__init__�sl���-�-��%�%���$������#'�&���t�x� ������������"������"����r c���t|j�tdz��d��}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 response��zHTTP/r!i�)�strrVrSrTrArrh�print�reprr�split�
ValueError�
startswith�_close_connr�int)rErIrlrmrns     r�_read_statuszHTTPResponse._read_statuss����4�7�#�#�H�q�L�1�1�<�@�@���t�9�9�x����m�,�,�,��?�Q����(�D��J�J�'�'�'��	2�%�&1�2�2�
2�	�&*�j�j��q�&9�&9�#�G�V�V�V���	�	�	�
�"&�*�*�T�1�"5�"5���������
�
�
�����
������		�����!�!�'�*�*�	&���������%�%�%�	&���[�[�F���|�|�v��|�|�#�D�)�)�)� ,���	&�	&�	&���%�%�%�	&�������&�&sB�B-�-
C)�8C�C)�C#� C)�"C#�#C)�(C)�%*E�E*c��|j�dS	|���\}}}|tkrn1t|j��}|jdkrt
d|��~�U|x|_|_|�	��|_
|dvrd|_n,|�d��rd|_nt|���t|j��x|_|_|jdkr3|j���D]\}}t
d|d	z|���|j�d
��}|r'|���dkrd|_d|_nd|_|���|_d|_|j�d
��}|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-encodingroF�content-lengthr!���HEAD)rWr��CONTINUErXrVrhr{�coderm�striprnrlrrrcrj�items�getr@rorp�_check_closerrrqr�r~�
NO_CONTENT�NOT_MODIFIEDri)	rErlrmrn�skipped_headers�hdr�val�tr_encrqs	         r�beginzHTTPResponse.begin>s����<�#��F�	 �&*�&7�&7�&9�&9�#�G�V�V���!�!��+�D�G�4�4�O����"�"��j�/�2�2�2��	 �#)�(��	�D�K��l�l�n�n����.�.�.��D�L�L�
�
�
�	�
*�
*�	+��D�L�L�!�'�*�*�*�"/���"8�"8�8���t�x��?�Q��� �L�.�.�0�0�
1�
1���S��i��s��C�0�0�0�0���!�!�"5�6�6���	!�f�l�l�n�n�	�1�1��D�L�"�D�O�O� �D�L��+�+�-�-��������!�!�"2�3�3���		�$�,�		�
'�!�&�k�k����;��?�?�"&�D�K���	�
#�
#�
#�"�����
#�����D�K�
�j� � �F�l�$:�$:��6�����C������L�F�"�"��D�K�
��	#���	#��K��"�D�O�O�O�	#�	#�	#�	#��s�+G�G&�%G&c�\�|j�d��}|jdkr|rd|���vrdSdS|j�d��rdS|rd|���vrdS|j�d��}|rd|���vrdSdS)N�
connectionr��closeTFz
keep-alivezproxy-connection)rWr�rlr@)rE�conn�pconns   rr�zHTTPResponse._check_close�s����|����-�-���<�2����
��4�:�:�<�<�/�/��t��5��<���L�)�)�	��5��	�L�D�J�J�L�L�0�0��5��� � �!3�4�4���	�\�U�[�[�]�]�2�2��5��tr c�J�|j}d|_|���dS�N)rVr�)rErVs  rr�zHTTPResponse._close_conn�s!��
�W�����
���
�
�
�
�
r c����	t�����|jr|���dSdS#|jr|���wwxYwr�)�superr�rVr��rE�	__class__s �rr�zHTTPResponse.close�sl���	#��G�G�M�M�O�O�O��w�
#�� � �"�"�"�"�"�
#�
#��t�w�
#�� � �"�"�"�"�
#���s� A�A c���t�����|jr|j���dSdSr�)r��flushrVr�s �rr�zHTTPResponse.flush�s;���
���
�
�����7�	��G�M�M�O�O�O�O�O�	�	r c��	dS)NTr�rEs r�readablezHTTPResponse.readable�s
��!��tr c��	|jduSr�)rVr�s r�isclosedzHTTPResponse.isclosed�s��/��w�$��r c��	|j�dS|jdkr|���dS|jr|�|��S|��|j�||jkr|j}|j�|��}|s|r|���n?|j�8|xjt|��zc_|js|���|S|j�|j���}nF	|�|j��}n##t$r|����wxYwd|_|���|S)Nr r�r)
rVrir�ro�
_read_chunkedrq�readrA�
_safe_readr)rE�amt�ss   rr�zHTTPResponse.read�sp��M��7�?��3��<�6�!�!��������3��<�	+��%�%�c�*�*�*��?��{�&�3���+<�+<��k������S�!�!�A��
'��
'�� � �"�"�"�"���(����s�1�v�v�%����{�'��$�$�&�&�&��H��{�"��G�L�L�N�N���������4�4�A�A��%�����$�$�&�&�&������ ����������Hs�9D� D4c���	|j�dS|jdkr|���dS|jr|�|��S|j�4t
|��|jkrt|��d|j�}|j�|��}|s|r|���n2|j�+|xj|zc_|js|���|S)Nrr�)	rVrir�ro�_readinto_chunkedrqrA�
memoryview�readinto)rE�brFs   rr�zHTTPResponse.readinto�s���	��7�?��1��<�6�!�!��������1��<�	-��)�)�!�,�,�,��;�"��1�v�v���#�#��q�M�M�!�D�K�-�0��

�G���Q�����	#�Q�	#�
�������
�[�
$��K�K�1��K�K��;�
#�� � �"�"�"��r c�F�|j�tdz��}t|��tkrt	d���|�d��}|dkr
|d|�}	t
|d��S#t$r|����wxYw)Nr?z
chunk size�;r�)	rVrSrTrAr�findr�r~r�)rErI�is   r�_read_next_chunk_sizez"HTTPResponse._read_next_chunk_sizes����w����1��-�-���t�9�9�x����l�+�+�+��I�I�d�O�O����6�6�����8�D�	��t�R�=�=� ���	�	�	�
�������		���s�0B� B c��	|j�tdz��}t|��tkrt	d���|sdS|dvrdS�T)NTr?ztrailer linerP)rVrSrTrAr�rErIs  r�_read_and_discard_trailerz&HTTPResponse._read_and_discard_trailer#sd��		��7�#�#�H�q�L�1�1�D��4�y�y�8�#�#�!�.�1�1�1��
����,�,�,���		r c��|j}|s�|�|�d��	|���}n#t$rt	d���wxYw|dkr*|���|���d}||_|S)Nrxr r)rpr�r�r~rr�r�)rErps  r�_get_chunk_leftzHTTPResponse._get_chunk_left1s����_�
��	)��%�����"�"�"�
*�!�7�7�9�9�
�
���
*�
*�
*�$�S�)�)�)�
*�����Q����.�.�0�0�0�� � �"�"�"�!�
�(�D�O��s	�7�Ac��g}		|���}|�nr|�9||kr3|�|�|����||z
|_n7|�|�|����|�||z}d|_��d�|��S#t
$r(}td�|����|�d}~wwxYw)NTrr )r�rDr�rpr\r)rEr��valuerp�excs     rr�zHTTPResponse._read_chunkedIs�����	;�

$�!�1�1�3�3�
��%���?�s�j�'8�'8��L�L�����!5�!5�6�6�6�&0�3�&6�D�O�����T�_�_�Z�8�8�9�9�9��?��:�%�C�"#���

$��8�8�E�?�?�"���	;�	;�	;� ����%���1�1�s�:�����	;���s�BB#�#
C�-#C�Cc��d}t|��}		|���}|�|St|��|kr$|�|��}||z
|_||zS|d|�}|�|��}||d�}||z
}d|_��#t
$r%tt
|d|������wxYw)Nr)r�r�rA�_safe_readintorpr�bytes)rEr��total_bytes�mvbrprF�temp_mvbs       rr�zHTTPResponse._readinto_chunked_s�������m�m��	:�
$�!�1�1�3�3�
��%�&�&��s�8�8�z�)�)��+�+�C�0�0�A�&0�1�n�D�O�&��?�*��{�
�{�+���'�'��1�1���!�"�"�g���q� ��"#���
$�� �	:�	:�	:� ��q��;��'7�!8�!8�9�9�9�	:���s�B�6B�#6B�/Cc��	|j�|��}t|��|kr t||t|��z
���|Sr�)rVr�rAr)rEr�r%s   rr�zHTTPResponse._safe_readwsJ��	��w�|�|�C� � ���t�9�9�s�?�?� ��s�3�t�9�9�}�5�5�5��r c��	t|��}|j�|��}||kr(tt	|d|���||z
���|Sr�)rArVr�rr�)rEr�r�rFs    rr�zHTTPResponse._safe_readinto�sU��@��!�f�f���G���Q�����s�7�7� ��q��!��u���s�1�u�5�5�5��r ���c��	|j�|jdkrdS|jr|�|��S|j�|dks||jkr|j}|j�|��}|s|r|���n?|j�8|xjt|��zc_|js|���|S�Nr�r r)rVriro�_read1_chunkedrq�read1r�rA)rErF�results   rr�zHTTPResponse.read1�s���	��7�?�d�l�f�4�4��3��<�	*��&�&�q�)�)�)��;�"��A����T�[�����A�����q�!�!���	#�!�	#��������
�[�
$��K�K�3�v�;�;�&�K�K��;�
#�� � �"�"�"��
r c��|j�|jdkrdS|jr|�|��S|j�|��S)Nr�r )rVriro�
_peek_chunked�peek)rErFs  rr�zHTTPResponse.peek�sL���7�?�d�l�f�4�4��3��<�	)��%�%�a�(�(�(��w�|�|�A���r c���|j�|jdkrdS|jr!t���|��S|j�|dks||jkr|j}|j�|��}|s|r|���n?|j�8|xjt|��zc_|js|���|Sr�)rVriror�rSrqr�rA)rE�limitr�r�s   �rrSzHTTPResponse.readline�s�����7�?�d�l�f�4�4��3��<�	+��7�7�#�#�E�*�*�*��;�"���	�	�U�T�[�5H�5H��K�E���!�!�%�(�(���	#�%�	#��������
�[�
$��K�K�3�v�;�;�&�K�K��;�
#�� � �"�"�"��
r c���|���}|�|dkrdSd|cxkr|ksn|}|j�|��}|xjt	|��zc_|std���|S)Nrr )r�rVr�rprAr)rErFrpr�s    rr�zHTTPResponse._read1_chunked�s����)�)�+�+�
����a����3��Q�$�$�$�$�*�$�$�$�$��A��w�}�}�Q�������3�t�9�9�$����	&� ��%�%�%��r c��	|���}n#t$rYdSwxYw|�dS|j�|��d|�S)Nr )r�rrVr�)rErFrps   rr�zHTTPResponse._peek_chunked�sf��	��-�-�/�/�J�J���	�	�	��3�3�	�������3��w�|�|�J�'�'����4�4s��
%�%c�4�|j���Sr�)rV�filenor�s rr�zHTTPResponse.fileno�s���w�~�~���r c���	|j�t���|j�|��p|}t|t��st|d��s|Sd�|��S)N�__iter__z, )rWr�get_all�
isinstancerz�hasattrr\)rEr/�defaultrWs    r�	getheaderzHTTPResponse.getheader�sq��
	��<��"�$�$�$��,�&�&�t�,�,�7����g�s�#�#�	&�7�7�J�+G�+G�	&��N��9�9�W�%�%�%r c�z�	|j�t���t|j�����Sr�)rWr�listr�r�s r�
getheaderszHTTPResponse.getheaders�s5��4��<��"�$�$�$��D�L�&�&�(�(�)�)�)r c��|Sr�rr�s rr�zHTTPResponse.__iter__�s���r c��	|jSr�)rWr�s r�infozHTTPResponse.info�s��	�(�|�r c��	|jSr�)rur�s r�geturlzHTTPResponse.geturls��	��x�r c��	|jSr�)rmr�s r�getcodezHTTPResponse.getcodes��	��{�r )rNNr�)r�)"rKrLrMrvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rSr�r�r�r�r�r�r�r�r��
__classcell__�r�s@rrr�s)�������#�#�#�#�<'�'�'�BF#�F#�F#�P���:���
#�#�#�#�#������
������&�&�&�&�P � � �D��� ������0;�;�;�;�,:�:�:�0
�
�
��������&����������"���5�5�5� � � �&�&�&�&�(*�*�*����
���.
�
�
�������r rc��eZdZdZdZeZeZdZ	dZ
ed���Zed���Z
dejddfd	�Zd!d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd"d�Z		d#d�Zd�Zd�Zd�Zd�Z d�Z!d$dd�d�Z"difdd�d�Z#d�Z$d �Z%dS)%rr�zHTTP/1.1r?rc�8�	t|tj��Sr�)r��io�
TextIOBase)�streams r�
_is_textIOzHTTPConnection._is_textIO+s��	��&�"�-�0�0�0r c��	|�|���tvrdSdSt|d��rdS	t|��}|jS#t
$rYnwxYwt
|t��rt|��SdS)Nrr�)	�upper�_METHODS_EXPECTING_BODYr�r��nbytes�	TypeErrorr�rzrA)�bodyrt�mvs   r�_get_content_lengthz"HTTPConnection._get_content_length1s���	��<��|�|�~�~�!8�8�8��q��t��4�� � �	��4�	��D�!�!�B��9����	�	�	��D�	�����d�C� � �	��t�9�9���ts�A�
A�AN� c�F�||_||_||_d|_g|_d|_t|_d|_d|_	d|_
i|_|�||��\|_
|_|�|j
��t j|_dSr�)�timeout�source_address�	blocksizers�_buffer�_HTTPConnection__response�_CS_IDLE�_HTTPConnection__stateri�_tunnel_host�_tunnel_port�_tunnel_headers�
_get_hostport�host�port�_validate_host�socket�create_connection�_create_connection)rErr	r�r�r�s      rrvzHTTPConnection.__init__Qs������,���"�����	������������� ��� ���!���!%�!3�!3�D�$�!?�!?����D�I����D�I�&�&�&�#)�":����r c���	|jrtd���|�||��\|_|_|r	||_dS|j���dS)Nz.Can't set up tunnel for established connection)rs�RuntimeErrorrrrr�clear)rErr	rWs    r�
set_tunnelzHTTPConnection.set_tunnelgst��	��9�	Q��O�P�P�P�/3�/A�/A�$��/M�/M�,���4�,��	)�#*�D� � � �� �&�&�(�(�(�(�(r c��|��|�d��}|�d��}||krm	t||dzd���}nF#t$r9||dzd�dkr|j}nt	d||dzd�z���YnwxYw|d|�}n|j}|r"|ddkr|ddkr
|dd�}||fS)	Nr>�]r?ryznonnumeric port: '%s'r�[r�)�rfindr�r~�default_portr)rErr	r��js     rrzHTTPConnection._get_hostports���<��
�
�3���A��
�
�3���A��1�u�u�O��t�A�a�C�D�D�z�?�?�D�D��!�O�O�O��A�a�C�D�D�z�R�'�'�#�0���(�)@�4��!����:�)M�N�N�N���O����
�B�Q�B�x����(���	�D��G�s�N�N�t�B�x�3�����"��:�D��d�|�s�A�AB�Bc��||_dSr�)rh)rE�levels  r�set_debuglevelzHTTPConnection.set_debuglevel�s
������r c�6�d|vr|ddkrd|zdzS|S)N�:r�[�[r6r)rE�ips  r�
_wrap_ipv6zHTTPConnection._wrap_ipv6�s-���2�:�:�"�Q�%�7�*�*��"�9�t�#�#��	r c��d|�|j�d����|jfz}|g}|j���D]3\}}|�|�d|�d��d�����4|�d��|�d�|����~|�	|j
|j���}	|���\}}}|tjjkr;|���t#d	|�d
|��������	|j�t*dz��}	t-|	��t*krt/d
���|	sn3|	dvrn.|jdkr"t3d|	������|���dS#|���wxYw)NsCONNECT %s:%d HTTP/1.0
�asciiz: �
r'rQr �rtzTunnel connection failed: � Tr?rOrPrr�)r rr(rrr�rD�sendr\�response_classrsrir��http�
HTTPStatus�OKr��OSErrorr�rVrSrTrArrhr{r])
rE�connectrW�headerr��responserlr��messagerIs
          r�_tunnelzHTTPConnection._tunnel�s���/��O�O�D�-�4�4�W�=�=�>�>���3����)��!�1�7�7�9�9�	G�	G�M�F�E��N�N�f�3�3��3�3�3�:�:�9�E�E�F�F�F�F����w����	
�	�	�#�(�(�7�#�#�$�$�$���&�&�t�y���&�F�F��	�'/�'<�'<�'>�'>�$�W�d�G��t��)�)�)��
�
�����S�4�S�S�'�-�-�/�/�S�S�T�T�T�
4��{�+�+�H�q�L�9�9���t�9�9�x�'�'�%�m�4�4�4�����0�0�0���?�Q�&�&��)�T�[�[�]�]�3�3�3�
4�
�N�N�������H�N�N�������s
�(C(G&�&G<c��	tjd||j|j��|�|j|jf|j|j��|_	|j�tj
tjd��n-#t$r }|j
tjkr�Yd}~nd}~wwxYw|jr|���dSdS)Nzhttp.client.connectr?)�sys�auditrr	r
r�r�rs�
setsockoptr�IPPROTO_TCP�TCP_NODELAYr+�errno�ENOPROTOOPTrr0�rE�es  rr,zHTTPConnection.connect�s���A��	�'��t�y�$�)�D�D�D��+�+�
�Y�t�y�!�4�<��1D�F�F��	�	��I� � ��!3�V�5G��K�K�K�K���	�	�	��w�%�+�+�+��,�+�+�+�+�����	������	��L�L�N�N�N�N�N�	�	s�0B�
B1�B,�,B1c�
�	t|_	|j}|rd|_|���|j}|rd|_|���dSdS#|j}|rd|_|���wwxYwr�)rrrsr�r)rErsr.s   rr�zHTTPConnection.close�s���6����		!��9�D��
� ��	��
�
������H��
!�"&������ � � � � �
!�
!����H��
!�"&������ � � � �
!���s�$A�'Bc�~�	|j�*|jr|���nt���|jdkrtdt
|����t|d��r�|jdkrtd��|�|��}|r|jdkrtd��	|�	|j
��}|snH|r|�d��}tj
d||��|j�|���edStj
d||��	|j�|��dS#t$rat!|t"jj��r"|D]}|j�|���YdStd	t)|��z���wxYw)
Nrzsend:r�zsending a readable�encoding file using iso-8859-1r?rZzhttp.client.sendz9data should be a bytes-like object or an iterable, got %r)rs�	auto_openr,rrhr{r|r�r�r�r�r(r2r3�sendallr�r��collections�abc�Iterable�type)rEr%r(�	datablock�ds     rr&zHTTPConnection.send�s���	�
�9���~�
%��������"�n�n�$��?�Q����'�4��:�:�&�&�&��4�� � �	����"�"��*�+�+�+��_�_�T�*�*�F��
8�$�/�A�-�-��6�7�7�7�
-� �I�I�d�n�5�5�	� ����?� )� 0� 0�� >� >�I��	�,�d�I�>�>�>��	�!�!�)�,�,�,�
-�
�F��	�$�d�D�1�1�1�	G��I���d�#�#�#�#�#���	G�	G�	G��$��� 8�9�9�
G��)�)�A��I�%�%�a�(�(�(�(�)�)�)� �!9�;?��:�:�!F�G�G�G�	G���s�5E�AF<� F<c�<�	|j�|��dSr�)rrD)rEr�s  r�_outputzHTTPConnection._outputs%��	�	
����A�����r c#�K�|jdkrtd��|�|��}|r|jdkrtd��	|�|j��}|sdS|r|�d��}|V��:)Nrzreading a readabler=TrZ)rhr{r�r�r�r()rEr�r(rDs    r�_read_readablezHTTPConnection._read_readables������?�Q����&�'�'�'�����*�*���	4�d�o��)�)��2�3�3�3�	� �
�
�d�n�5�5�I��
����
;�%�,�,�\�:�:�	��O�O�O�
	r Fc���	|j�d��d�|j��}|jdd�=|�|��|��t	|d��r|�|��}nb	t
|��|f}nN#t$rA	t|��}n-#t$r tdt|��z���wxYwYnwxYw|D]m}|s|j
dkrtd���|r7|jdkr,t|��d�d	��d
��|zdz}|�|���n|r$|jdkr|�d��dSdSdSdS)N)r r rQr�zAmessage_body should be a bytes-like object or an iterable, got %rrzZero length chunk ignoredr��Xr#r"s0

)r�extendr\r&r�rIr�r��iterrCrhr{�	_http_vsnrAr()rE�message_body�encode_chunkedrj�chunks�chunks      r�_send_outputzHTTPConnection._send_outputs���	�
	
����J�'�'�'��l�l�4�<�(�(���L����O��	�	�#�����#��|�V�,�,�
-��,�,�\�:�:���-�
�|�,�,�,�+�_�F�F��!�>�>�>�>�!%�l�!3�!3����$�>�>�>�'�)H�*.�|�*<�*<�)=�>�>�>�>������>���� �

!�

!�������*�*��9�:�:�:��!�"�d�n��&:�&:�"�5�z�z�1�1�1�1�8�8��A�A�E�I�!�"�E��	�	�%� � � � ��
(�$�.�B�"6�"6��	�	�,�'�'�'�'�'�S$�#�N
(�
(�"6�"6s*�?B�
C�B-�,C�-*C�C�Cc��	|jr |j���rd|_|jtkr
t|_nt|j���|�|��||_|pd}|�|��|�d|�d|j	��}|�
|�|����|jdk�r�|�shd}|�
d��rt|��\}}}}}|r`	|�d��}n%#t $r|�d��}YnwxYw|�dt%|����n�|jr|j}	|j}
n|j}	|j}
	|	�d��}n%#t $r|	�d��}YnwxYw|�|��}d	|	vrt%|��}|
|jkr|�d|��n0|�d��}|�d|�d	|
����|s|�d
d��dSdSdS)N�/r%r�ryr(r"�idna�Hostr>zAccept-Encoding�identity)rr�rr�_CS_REQ_STARTEDr�_validate_methodri�_validate_path�
_http_vsn_strrG�_encode_requestrNrrr(r)�	putheaderr:rrrr	r rr])rErtru�	skip_host�skip_accept_encoding�request�netloc�nil�
netloc_encrr	�host_encs            r�
putrequestzHTTPConnection.putrequestOs���	��?�	#�t��7�7�9�9�	#�"�D�O�*�<�8�#�#�*�D�L�L�#�D�L�1�1�1����f�%�%�%�����j�S�����C� � � � &������T�-?�-?�@�����T�)�)�'�2�2�3�3�3��>�R����0
K����>�>�&�)�)�?�19�#���.�C���c�3��K�;�%+�]�]�7�%;�%;�
�
��-�;�;�;�%+�]�]�6�%:�%:�
�
�
�;�����N�N�6�+<�Z�+H�+H�I�I�I�I��(�)�#�0��#�0���#�y��#�y��7�#'�;�;�w�#7�#7����-�7�7�7�#'�;�;�v�#6�#6����7����
 $���x�8�8�H��d�{�{�#4�X�#>�#>���t�0�0�0����v�x�8�8�8�8�#+�?�?�7�#;�#;�����v�(�(�(�D�D�/I�J�J�J�(�
>����0�*�=�=�=�=�=�
>�
>�
�Ds$�D�D<�;D<�F�G�?Gc�,�|�d��S)Nr")r()rEras  rr]zHTTPConnection._encode_request�s���~�~�g�&�&�&r c��	t�|��}|r(td|�d|����d����dS)Nz)method can't contain control characters. � (found at least �))�$_contains_disallowed_method_pchar_re�searchr~�group)rErt�matchs   rrZzHTTPConnection._validate_method�sg��4�4�;�;�F�C�C���	;��:��:�:�',�{�{�}�}�:�:�:�;�;�
;�	;�	;r c��	t�|��}|r(td|�d|����d����dS�Nz&URL can't contain control characters. rirj��!_contains_disallowed_url_pchar_rerlrrm)rErurns   rr[zHTTPConnection._validate_path�ss��,�1�8�8��=�=���	D��C�c�C�C�05���
�
�C�C�C�D�D�
D�	D�	Dr c��	t�|��}|r(td|�d|����d����dSrprq)rErrns   rr
zHTTPConnection._validate_host�ss��G�1�8�8��>�>���	D��C�d�C�C�05���
�
�C�C�C�D�D�
D�	D�	Dr c��	|jtkrt���t|d��r|�d��}t|��st
d|�����t|��}t|��D]�\}}t|d��r|�d��||<n:t|t��r%t|���d��||<t||��rt
d||�������d�
|��}|dz|z}|�|��dS)Nr(r"zInvalid header name r'zInvalid header value s
	s: )rrYrr�r(�_is_legal_header_namer~r��	enumerater�r�rz�_is_illegal_header_valuer\rG)rEr-�valuesr��	one_valuer�s      rr^zHTTPConnection.putheader�sZ��	��<�?�*�*�"�$�$�$��6�8�$�$�	,��]�]�7�+�+�F�$�V�,�,�	C��*���A�B�B�B��f����%�f�-�-�	K�	K�L�A�y��y�(�+�+�
;�%�,�,�Y�7�7��q�	�	��I�s�+�+�
;��	�N�N�1�1�'�:�:��q�	�'��q�	�2�2�
K� �j�f�Q�i�i�!I�J�J�J�
K����v�&�&���%��%�'�����V�����r �rPc��	|jtkr
t|_nt���|�||���dS)Nrz)rrY�_CS_REQ_SENTrrS)rErOrPs   r�
endheaderszHTTPConnection.endheaderssJ��	��<�?�*�*�'�D�L�L�"�$�$�$����,�~��F�F�F�F�Fr c�:�	|�|||||��dSr�)�
_send_request)rErtrur�rWrPs      rrazHTTPConnection.requests'��4����6�3��g�~�F�F�F�F�Fr c�V�td�|D����}i}d|vrd|d<d|vrd|d<|j||fi|��d|vrzd|vrud	}|�||��}|�8|�5|jd
krt	d|z��d}|�d
d��n&|�dt
|����nd	}|���D]\}	}
|�|	|
���t|t��rt|d��}|�
||���dS)Nc3�>K�|]}|���V��dSr�)r@)r�ks  r�	<genexpr>z/HTTPConnection._send_request.<locals>.<genexpr>s*���� <� <�q������ <� <� <� <� <� <r rr?r_zaccept-encodingr`r�r�FrzUnable to determine size of %rTzTransfer-EncodingrozContent-Lengthr�rz)�	frozensetrfr�rhr{r^rzr�r�r1r})rErtrur�rWrP�header_names�skips�content_lengthr�r�s           rrzHTTPConnection._send_requests|�� � <� <�G� <� <� <�<�<�����\�!�!�!"�E�+����,�,�,-�E�(�)������-�-�u�-�-�-��<�/�/�#�,�6�6�"'��!%�!9�!9�$��!G�!G��!�)��'��?�Q�.�.�!�"B�T�"I�J�J�J�)-�����':�I�F�F�F���N�N�#3�S��5H�5H�I�I�I��"�N�!�-�-�/�/�	'�	'�J�C���N�N�3��&�&�&�&��d�C� � �	)��4��(�(�D�����^��<�<�<�<�<r c�Z�	|jr |j���rd|_|jtks|jrt	|j���|jdkr(|�|j|j|j���}n!|�|j|j���}		|�	��n##t$r|����wxYwt|_|j
r|���n||_|S#|����xYw)Nrr$)rr�rr|rrhr'rsrir��ConnectionErrorr�rrr)rEr.s  r�getresponsezHTTPConnection.getresponseGs@��	��?�	#�t��7�7�9�9�	#�"�D�O�"�<�<�'�'�4�?�'�"�4�<�0�0�0��?�Q����*�*�4�9�d�o�26�,�+�@�@�H�H��*�*�4�9�T�\�*�J�J�H�	�
���� � � � ��"�
�
�
��
�
�����
����$�D�L��"�
+��
�
�����#+����O��	��N�N�������s�*B?�>D�? C�3D�D*)NN)NF)FFr�)&rKrLrMrNr\rr'�	HTTP_PORTrr>rh�staticmethodr�r�r�_GLOBAL_DEFAULT_TIMEOUTrvrrrr r0r,r�r&rGrIrSrfr]rZr[r
r^r}rarr�rr rrr!s#�������I��M�!�N��L��I��J��1�1��\�1�
����\��>#'��0N� $��;�;�;�;�,)�)�)�)�0���( � � ����
"�"�"�H
�
�
�!�!�!�&G�&G�&G�P������4(�4(�4(�4(�l16�(-�}�}�}�}�~'�'�'�;�;�;�D�D�D�D�D�D����8G�e�G�G�G�G�G�)-�b�G�$�G�G�G�G�G�
,=�,=�,=�\=�=�=�=�=r rc�N��eZdZ	eZdddejdfdddd��fd�Z�fd�Z�xZ	S)�HTTPSConnectionNr�)�context�check_hostnamer�c�2��tt|���|||||	���|�|�|� ddl}
|
�dt
d��||_||_|�Btj	��}|j
dkr|�dg��|j�d|_|j
tjk}|�|j}|r|st!d���|s|r$|�||��|j�d|_||_|�||j_dSdS)	N)r�rzTkey_file, cert_file and check_hostname are deprecated, use a custom context instead.rxr�zhttp/1.1TzMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED)r�r�rv�warnings�warn�DeprecationWarning�key_file�	cert_file�ssl�_create_default_https_contextrN�set_alpn_protocols�post_handshake_auth�verify_mode�	CERT_NONEr�r~�load_cert_chain�_context)
rErr	r�r�r�r�r�r�r�r��will_verifyr�s
            �rrvzHTTPSConnection.__init__�su���
�/�4�(�(�1�1�$��g�2@�<E�
2�
G�
G�
G��$�	�(=�&�2������
�
�J�0�!�5�5�5�%�D�M�&�D�N����;�=�=���>�R�'�'��.�.�
�|�<�<�<��.�:�26�G�/�!�-���>�K��%�!(�!7���
J�k�
J� �"I�J�J�J��
7�9�
7��'�'�	�8�<�<�<��.�:�26�G�/�#�D�M��)�/=��
�,�,�,�*�)r c����	t�����|jr|j}n|j}|j�|j|���|_dS)N)�server_hostname)r�r,rrr��wrap_socketrs)rEr�r�s  �rr,zHTTPSConnection.connect�sa���6��G�G�O�O����� �
,�"&�"3���"&�)���
�1�1�$�)�BQ�2�S�S�D�I�I�Ir )
rKrLrM�
HTTPS_PORTrrr�rvr,r�r�s@rr�r��s��������2�!��'+�T�T�#�;�$(�%	>�59�$(�D�%	>�%	>�%	>�%	>�%	>�%	>�%	>�N	S�	S�	S�	S�	S�	S�	S�	S�	Sr r�c��eZdZdS)rN�rKrLrMrr rrr�s������	�Dr rc��eZdZdS)rNr�rr rrr���������Dr rc��eZdZdS)rNr�rr rrr�r�r rc��eZdZd�ZdS)rc�$�|f|_||_dSr�)�argsrl)rErls  rrvzUnknownProtocol.__init__�s���H��	�����r N�rKrLrMrvrr rrr�s#����������r rc��eZdZdS)r	Nr�rr rr	r	�r�r r	c��eZdZdS)r
Nr�rr rr
r
�r�r r
c�*�eZdZdd�Zd�ZejZdS)rNc�2�|f|_||_||_dSr�)r��partial�expected)rEr�r�s   rrvzIncompleteRead.__init__�s���H��	���� ��
�
�
r c�r�|j�d|jz}nd}d|jjt|j��|fzS)Nz, %i more expectedryz%s(%i bytes read%s))r�r�rKrAr�r9s  r�__repr__zIncompleteRead.__repr__�sE���=�$�$�t�}�4�A�A��A�$���(?�(+�D�L�(9�(9�1�(>�>�	>r r�)rKrLrMrvr�r+�__str__rr rrr�s:������!�!�!�!�>�>�>��n�G�G�Gr rc��eZdZdS)r
Nr�rr rr
r
�r�r r
c��eZdZdS)rNr�rr rrr�r�r rc��eZdZdS)rNr�rr rrr�r�r rc��eZdZdS)rNr�rr rrr�r�r rc��eZdZd�ZdS)rc�F�|st|��}|f|_||_dSr�)r|r�rIr�s  rrvzBadStatusLine.__init__�s)���	���:�:�D��E��	���	�	�	r Nr�rr rrr�s#����������r rc��eZdZd�ZdS)rc�P�t�|dt|fz��dS)Nz&got more than %d bytes when reading %s)rrvrT)rE�	line_types  rrvzLineTooLong.__init__s6�����t�%M�(0�)�'<�&=�	>�	>�	>�	>�	>r Nr�rr rrr�s#������>�>�>�>�>r rc��eZdZd�ZdS)rc�f�t�|d��tj|g|�Ri|��dS)Nry)rrv�ConnectionResetError)rE�pos�kws   rrvzRemoteDisconnected.__init__s?�����t�R�(�(�(��%�d�7�S�7�7�7�B�7�7�7�7�7r Nr�rr rrrs#������8�8�8�8�8r r)r%)D�email.parserr^�
email.messager7r(r��rerr2�collections.abcr@�urllib.parser�__all__r�r�rkrrYr|�globals�updater)�__members__rxrrTrU�compile�	fullmatchrurlrwrrrkr�r1r�r:r/�Messager<rXrc�BufferedIOBaserrr�r�rD�ImportError�	Exceptionrrrrr	r
rr
rrrrrr�rrrr r�<module>r�s=��D�L����������������	�	�	�	�	�	�	�	�
�
�
�
�
�
�
�
�����!�!�!�!�!�!�����
�	�
�
�����#������	�	�����,�-�-�-�
H�G�$�/�"=�"D�"D�"F�"F�G�G�G�	�����6#��
�#6�7�7�A��%�2�:�&C�D�D�K��%/�B�J�/@�$A�$A�!�(2�r�z�-�'@�'@�$�3�2�2��E�E�E�E����%����������%�-�'����<���$)�@�@�@�@�i�i�i�i�i�2�$�i�i�i�Vc	�c	�c	�c	�c	�c	�c	�c	�J@&��J�J�J�9S�9S�9S�9S�9S�.�9S�9S�9S�v�N�N�$�%�%�%�%��}�	�	�	��D�	����@	�	�	�	�	�I�	�	�	�
	�	�	�	�	�=�	�	�	�	�	�	�	�	��	�	�	������m����
	�	�	�	�	�m�	�	�	�	�	�	�	�	�M�	�	�	������]����	�	�	�	�	�m�	�	�	�	�	�	�	�	�/�	�	�	�	�	�	�	�	�.�	�	�	�	�	�	�	�	�.�	�	�	������M����>�>�>�>�>�-�>�>�>�
8�8�8�8�8�-�}�8�8�8�	���s�*E�E�E