Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/future/backports/http/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/future/backports/http/__pycache__/client.cpython-311.pyc

�

�܋f��
��dZddlmZmZmZmZddlmZmZm	Z	m
Z
ddlmZddl
mZddl
mZddlmZddlZddlZddlZdd	lmZddlZdd
lmZerddlmZnddlmZgd�Zd
Z dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2d Z3d!Z4d"Z5d#Z6d$Z7d%Z8d&Z9d'Z:d(Z;d)Z<d*Z=d+Z>d,Z?d-Z@d.ZAd/ZBd0ZCd1ZDd2ZEd3ZFd4ZGd5ZHd6ZId7ZJd8ZKd9ZLd:ZMd;ZNd<ZOd=ZPd>ZQd?ZRd@ZSdAZTdBZUdCZVdDZWdEZXdFZYdGZZiddH�ddI�ddJ�ddK�ddL�ddM�ddN�ddO�ddP�ddQ�d dR�d!dS�d"dT�d#dU�d$dV�dWdX�d%dY�id&dZ�d'd[�d(d\�d)d]�d*d^�d+d_�d,d`�d-da�d.db�d/dc�d0dd�d1de�d2df�d3dg�d4dh�d5di�d6dj��dkdldmdndodpdqdrdsdtdudv��Z[dwZ\dxZ]dZ^Gdy�dzej_��Z`e`fd{�Zaeb��ZcGd|�d}ejd��ZeGd~�deb��Zf	ddlgZgdd�lgmhZhGd��d�ef��Zie�jd���n#ek$rYnwxYwGd��d�el��ZmGd��d�em��ZnGd��d�em��ZoGd��d�em��ZpGd��d�em��ZqGd��d�em��ZrGd��d�em��ZsGd��d�em��ZtGd��d�et��ZuGd��d�et��ZvGd��d�et��ZwGd��d�em��ZxGd��d�em��ZyemZzdS)�aD
HTTP/1.1 client library

A backport of the Python 3.3 http/client.py module for python-future.

<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
      |
      | response = getresponse()
      v
    Unread-response   [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>
�)�absolute_import�division�print_function�unicode_literals)�bytes�int�str�super)�PY2)�parser)�message)�create_connectionN)�urlsplit)�array)�Iterable)�HTTPResponse�HTTPConnection�
HTTPException�NotConnected�UnknownProtocol�UnknownTransferEncoding�UnimplementedFileMode�IncompleteRead�
InvalidURL�ImproperConnectionState�CannotSendRequest�CannotSendHeader�ResponseNotReady�
BadStatusLine�error�	responses�Pi��UNKNOWN�IdlezRequest-startedzRequest-sent�d�e�f������������������i,i-i.i/i0i1i3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i��i�i�i�i�����������i�i���ContinuezSwitching Protocols�OK�Created�AcceptedzNon-Authoritative Informationz
No Contentz
Reset ContentzPartial ContentzMultiple ChoiceszMoved Permanently�Foundz	See OtherzNot Modifiedz	Use Proxyi2z(Unused)zTemporary RedirectzBad Request�UnauthorizedzPayment Required�	Forbiddenz	Not FoundzMethod Not AllowedzNot AcceptablezProxy Authentication RequiredzRequest Timeout�Conflict�GonezLength RequiredzPrecondition FailedzRequest Entity Too LargezRequest-URI Too LongzUnsupported Media TypezRequested Range Not SatisfiablezExpectation FailedzPrecondition RequiredzToo Many RequestszRequest Header Fields Too LargezInternal Server ErrorzNot ImplementedzBad GatewayzService UnavailablezGateway TimeoutzHTTP Version Not SupportedzNetwork Authentication Required)r1r2r3r4r5r6r7r8r9r:r;iic��eZdZd�ZdS)�HTTPMessagec�8�|���dz}t|��}g}d}|���D]Z}|d|����|krd}n|dd����sd}|r|�|���[|S)a�Find 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�)�lower�len�keys�isspace�append)�self�name�n�lst�hit�lines      �m/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/future/backports/http/client.py�getallmatchingheadersz!HTTPMessage.getallmatchingheaders�s����z�z�|�|�c�!����I�I�������I�I�K�K�	!�	!�D��B�Q�B�x�~�~���4�'�'�����"�1�"�X�%�%�'�'�
����
!��
�
�4� � � ���
�N)�__name__�
__module__�__qualname__rV�rWrUrFrF�s#����������rWrFc���g}	|�tdz��}t|��tkrtd���|�|��t|��t
krt
dt
z���|dvrn��td���|���	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.

    TrI�header linezgot more than %d headers��
�
rWrW�
iso-8859-1)�_class)
�readline�_MAXLINErK�LineTooLongrN�_MAXHEADERSrr�join�decode�email_parser�Parser�parsestr)�fprb�headersrT�hstrings     rU�
parse_headersros����G���{�{�8�a�<�(�(���t�9�9�x����m�,�,�,����t�����w�<�<�+�%�%�� :�[� H�I�I�I��(�(�(����C�j�j�o�o�g�&�&�-�-�l�;�;�G���f�-�-�-�6�6�w�?�?�?rWc���eZdZdeddfd�Zd�Zd�Zd�Zd�Z�fd�Z	�fd	�Z
d
�Zd�Zd�fd�	Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd�Z�xZS)rrNc�b�|�d��|_||_|turt	jdtd��||_dx|_|_	t|_t|_t|_
t|_t|_t|_t|_dS)N�rb�ithe 'strict' argument isn't supported anymore; http.client now always assumes HTTP/1.x compliant servers.�)�makefilerl�
debuglevel�_strict_sentinel�warnings�warn�DeprecationWarning�_methodrm�msg�_UNKNOWN�version�status�reason�chunked�
chunk_left�length�
will_close)rO�sockrv�strict�method�urls      rU�__init__zHTTPResponse.__init__*s����-�-��%�%���$����)�)�)��M�M�"�A�
'�
'�
'����#'�&���t�x� ������������"������"����rWc���t|j�tdz��d��}t	|��tkrtd���|jdkrtdt|����|st|���	|�
dd��\}}}n?#t$r2	|�
dd��\}}d}n#t$rd}YnwxYwYnwxYw|�d��s#|�
��t|���	t|��}|d	ks|d
krt|���n#t$rt|���wxYw|||fS)NrIrazstatus linerzreply:rt�zHTTP/r%i�)r	rlrcrdrKrerv�print�reprr�split�
ValueError�
startswith�_close_connr)rOrTr~rr�s     rU�_read_statuszHTTPResponse._read_statusLs����4�7�#�#�H�q�L�1�1�<�@�@���t�9�9�x����m�,�,�,��?�Q����(�D��J�J�'�'�'��	&� ��%�%�%�	�&*�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�6�|j�dS	|���\}}}|tkrn~	|j�t
dz��}t
|��t
krtd���|���}|sn|j	dkrtd|���|��|x|_|_|���|_
|dvrd|_n,|�d��rd	|_nt!|���t#|j��x|_|_|j	dkr|jD]}td|d
����|j�d��}|r'|���d
krd|_d|_nd|_|���|_d|_|j�d��}|j�d��}|rF|js?	t5|��|_|jdkrd|_n#t6$r
d|_YnwxYwd|_|t8ks%|t:ksd|cxkrdks
n|jdkrd|_|js|js|j�
d|_dSdSdSdS)NTrIr]rzheader:)zHTTP/1.0zHTTP/0.9�
zHTTP/1.�� )�endztransfer-encodingr�F�content-lengthr%r(�HEAD)rmr��CONTINUErlrcrdrKre�striprvr��coderr�r~r�rror|�getrJr�r��_check_closer�r�rr��
NO_CONTENT�NOT_MODIFIEDr{)rOr~rr��skip�hdr�tr_encr�s        rU�beginzHTTPResponse.beginls����<�#��F�
	+�&*�&7�&7�&9�&9�#�G�V�V���!�!��
+��w�'�'��1��5�5���t�9�9�x�'�'�%�m�4�4�4��z�z�|�|������?�Q�&�&��)�T�*�*�*�
+�
	+�#)�(��	�D�K��l�l�n�n����.�.�.��D�L�L�
�
�
�	�
*�
*�	+��D�L�L�!�'�*�*�*�"/���"8�"8�8���t�x��?�Q����|�
/�
/���i��#�.�.�.�.�.���!�!�"5�6�6���	!�f�l�l�n�n�	�1�1��D�L�"�D�O�O� �D�L��+�+�-�-��������!�!�"2�3�3����!�!�"5�6�6���		�$�,�		�
'�!�&�k�k����;��?�?�"&�D�K���	�
#�
#�
#�"�����
#�����D�K�
�j� � �F�l�$:�$:��6�����C������L�F�"�"��D�K�
��	#���	#��K��"�D�O�O�O�	#�	#�	#�	#��s�;H"�"H6�5H6c��|j�d��}|jdkr6|j�d��}|rd|���vrdSdS|j�d��rdS|rd|���vrdS|j�d��}|rd|���vrdSdS)N�
connectionr��closeTFz
keep-alivezproxy-connection)rmr�r~rJ)rO�conn�pconns   rUr�zHTTPResponse._check_close�s����|����-�-���<�2����<�#�#�L�1�1�D��
��4�:�:�<�<�/�/��t��5��<���L�)�)�	��5��	�L�D�J�J�L�L�0�0��5��� � �!3�4�4���	�\�U�[�[�]�]�2�2��5��trWc�J�|j}d|_|���dS�N)rlr�)rOrls  rUr�zHTTPResponse._close_conn�s!��
�W�����
���
�
�
�
�
rWc���t�����|jr|���dSdSr�)r
r�rlr��rO�	__class__s �rUr�zHTTPResponse.close�s@���
���
�
�����7�	���������	�	rWc���t�����|jr|j���dSdSr�)r
�flushrlr�s �rUr�zHTTPResponse.flush�s;���
���
�
�����7�	��G�M�M�O�O�O�O�O�	�	rWc��dS)NTr[�rOs rU�readablezHTTPResponse.readable�s���trWc��|jduS)z!True if the connection is closed.N)rlr�s rU�isclosedzHTTPResponse.isclosed�s���w�$��rWc�D��|j�td��S|jdkr#|���td��S|�5tt	t
|���|����S|jr|���S|j	�|j���}nF	|�
|j	��}n##t$r|����wxYwd|_	|���t|��S)NrWr�r)rlrr{r�r
r�readr��_readall_chunkedr��
_safe_readr)rO�amt�sr�s   �rUr�zHTTPResponse.read�s����7�?���:�:���<�6�!�!���������:�:���?���|�T�2�2�7�7��<�<�=�=�=�
�|�
/��,�,�.�.�.��{�"��G�L�L�N�N���������4�4�A�A��%�����$�$�&�&�&������ �����������8�8�Os�:C� C5c�\�|j�dS|jdkr|���dS|jr|�|��S|j�4t
|��|jkrt|��d|j�}tr>|j�	t
|����}t
|��}||d|�<n|j�
|��}|s|r|���n2|j�+|xj|zc_|js|���|S)Nrr�)rlr{r�r��_readinto_chunkedr�rK�
memoryviewrr��readinto)rO�b�datarQs    rUr�zHTTPResponse.readintos2���7�?��1��<�6�!�!��������1��<�	-��)�)�!�,�,�,��;�"��1�v�v���#�#��q�M�M�!�D�K�-�0���	$��7�<�<��A���'�'�D��D�	�	�A��A�b�q�b�E�E��� � ��#�#�A��	#�Q�	#�
�������
�[�
$��K�K�1��K�K��;�
#�� � �"�"�"��rWc�F�|j�tdz��}t|��tkrt	d���|�d��}|dkr
|d|�}	t
|d��S#t$r|����wxYw)NrIz
chunk size�;r�)	rlrcrdrKre�findrr�r�)rOrT�is   rU�_read_next_chunk_sizez"HTTPResponse._read_next_chunk_sizeAs����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)NTrIztrailer liner^)rlrcrdrKre�rOrTs  rU�_read_and_discard_trailerz&HTTPResponse._read_and_discard_trailerQsd��		��7�#�#�H�q�L�1�1�D��4�y�y�8�#�#�!�.�1�1�1��
����,�,�,���		rWc��|jtksJ�|j}g}	|�Z	|���}|dkrn~n=#t$r0tt
d���|�����wxYw|�|�	|����|�	d��d}��|�
��|���t
d���|��S)NTrrWrt)r�r}r�r�r�rrrgrNr�r�r�)rOr��values   rUr�zHTTPResponse._readall_chunked_s���|�x�'�'�'�'��_�
���	��!�A�!%�!;�!;�!=�!=�J�!�Q����'��!�A�A�A�(��s������)?�)?�@�@�@�A�����L�L�����4�4�5�5�5�
�O�O�A�����J�	�	
�&�&�(�(�(�	
�������S�z�z���u�%�%�%s	�<�:A6c���|jtksJ�|j}d}t|��}	|�O	|���}|dkrn�n2#t
$r%t
t|d|������wxYwt|��|kr$|�	|��}||z
|_||zSt|��|kr6|�	|��}|�
d��d|_||zS|d|�}|�	|��}||d�}||z
}|�
d��d}��|���|���|S)NrTrt)
r�r}r�r�r�r�rrrK�_safe_readintor�r�r�)rOr�r��total_bytes�mvbrQ�temp_mvbs       rUr�zHTTPResponse._readinto_chunkedxs����|�x�'�'�'�'��_�
�����m�m��	��!�B�!%�!;�!;�!=�!=�J�!�Q����'��!�B�B�B�(��q��;��/?�)@�)@�A�A�A�B�����3�x�x�*�$�$��'�'��,�,��",�q�.���"�Q��&��S���Z�'�'��'�'��,�,������"�"�"�"&���"�Q��&��q��|�,���'�'��1�1���!�"�"�g���q� ��
�O�O�A�����J�5	�8	
�&�&�(�(�(�	
�������s�A�/A:c�n�g}|dkr�|j�t|t����}|s0t	td���|��|���|�|��|t|��z}|dk��td���|��S)aVRead the number of bytes requested, compensating for partial reads.

        Normally, we have a blocking socket, but a read() can be interrupted
        by a signal (resulting in a partial read).

        Note that we cannot distinguish between EOF and an interrupt when zero
        bytes have been read. IncompleteRead() will be raised in this
        situation.

        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.
        rrW)	rlr��min�	MAXAMOUNTrrrgrNrK)rOr�r��chunks    rUr�zHTTPResponse._safe_read�s���
���A�g�g��G�L�L��S�)�!4�!4�5�5�E��
>�$�U�3�Z�Z�_�_�Q�%7�%7��=�=�=�
�H�H�U�O�O�O��3�u�:�:��C��A�g�g��S�z�z���q�!�!�!rWc���d}t|��}|t|��k�r=tt|��kro|dt�}tr>|j�t|����}t|��}||d|�<nz|j�|��}n_tr>|j�t|����}t|��}||d|�<n|j�|��}|s2tt|d|���t|�����||d�}||z
}|t|��k��=|S)z2Same as _safe_read, but for reading into a buffer.rN)	r�rKr�rrlr�r�rr)rOr�r�r�r�r�rQs       rUr�zHTTPResponse._safe_readinto�sF������m�m���C��F�F�"�"��3�s�8�8�#�#��q��{�+���3��7�<�<��H�
�
�6�6�D��D�	�	�A�#'�H�R�a�R�L�L���(�(��2�2�A�A��.��7�<�<��C���1�1�D��D�	�	�A�"�C����G�G���(�(��-�-�A��
H�$�U�3�q��}�+=�%>�%>��A���G�G�G��a�b�b�'�C��1��K�'�C��F�F�"�"�(�rWc�4�|j���Sr�)rl�filenor�s rUr�zHTTPResponse.fileno�s���w�~�~���rWc���|j�t���|j�|��p|}t|t��st|d��s|Sd�|��S)N�__iter__z, )rmr�get_all�
isinstancer	�hasattrrg)rOrP�defaultrms    rU�	getheaderzHTTPResponse.getheader�sj���<��"�$�$�$��,�&�&�t�,�,�7����g�s�#�#�	&�7�7�J�+G�+G�	&��N��9�9�W�%�%�%rWc�x�|j�t���t|j�����S)z&Return list of (header, value) tuples.)rmr�list�itemsr�s rU�
getheaderszHTTPResponse.getheaders�s2���<��"�$�$�$��D�L�&�&�(�(�)�)�)rWc��|Sr�r[r�s rUr�zHTTPResponse.__iter__�s���rWc��|jSr�)rmr�s rU�infozHTTPResponse.info�s
���|�rWc��|jSr�)r�r�s rU�geturlzHTTPResponse.geturl�s	���x�rWc��|jSr�)rr�s rU�getcodezHTTPResponse.getcode�s
���{�rWr�)rXrYrZrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__�r�s@rUrr!s��������)*�2B�4�UY� #� #� #� #�D'�'�'�@N#�N#�N#�`���<���
����������
���
���������>#�#�#�J��� ���&�&�&�2'�'�'�R"�"�"�.���4 � � �&�&�&�&�*�*�*����
������������rWrc��eZdZdZdZeZeZdZ	dZ
deej
dfd�Zdd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zdd�Zdd�Zd�Zdd�Zdifd�Zd�Zd�Zd�ZdS)rr�zHTTP/1.1rIrNc��|turtjdtd��||_||_d|_g|_d|_t|_
d|_d|_d|_
i|_|�||��dS)Nrsrt)rwrxryrz�timeout�source_addressr��_buffer�_HTTPConnection__response�_CS_IDLE�_HTTPConnection__stater{�_tunnel_host�_tunnel_port�_tunnel_headers�
_set_hostport)rO�host�portr�r�r�s      rUr�zHTTPConnection.__init__�s����)�)�)��M�M�"�A�
'�
'�
'����,�����	������������� ��� ���!������4��&�&�&�&�&rWc�j�||_||_|r	||_dS|j���dS)z� Sets up the host and the port for the HTTP CONNECT Tunnelling.

        The headers argument should be a mapping of extra HTTP headers
        to send with the CONNECT request.
        N)r�r�r��clear)rOr�r�rms    rU�
set_tunnelzHTTPConnection.set_tunnelsE��!��� ����	)�#*�D� � � �� �&�&�(�(�(�(�(rWc��|��|�d��}|�d��}||krm	t||dzd���}nF#t$r9||dzd�dkr|j}nt	d||dzd�z���YnwxYw|d|�}n|j}|r"|ddkr|ddkr
|dd�}||_||_dS)	NrH�]rIr�znonnumeric port: '%s'r�[���)�rfindrr��default_portrr�r�)rOr�r�r��js     rUr�zHTTPConnection._set_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����(���
"��Q��3���4��8�s�?�?��A�b�D�z����	���	�	�	s�A�AB�Bc��||_dSr�)rv)rO�levels  rU�set_debuglevelzHTTPConnection.set_debuglevel2s
������rWc�D�|�|j|j��d|j|jfz}|�d��}|�|��|j���D]7\}}|�d|�d�}|�d��}|�|���8|�td����|�
|j|j���}|�
��\}}	}
|	dkr?|���tjd	|	|
���fz���	|j�t(dz��}t+|��t(krt-d���|sdS|d
vrdS�T)NzCONNECT %s:%d HTTP/1.0
�asciiz: z
�latin-1r_�r�r(zTunnel connection failed: %d %sTrIr]r^)r�r�r�r�r��encode�sendr�r�r�response_classr�r{r�r��socketr r�rlrcrdrKre)rO�connect_str�
connect_bytes�headerr��
header_str�header_bytes�responser~r�r
rTs            rU�_tunnelzHTTPConnection._tunnel5s������4�,�d�.?�@�@�@�2�d�i���5K�K��#�*�*�7�3�3�
��	�	�-� � � �!�1�7�7�9�9�	$�	$�M�F�E�)/������7�J�%�,�,�Y�7�7�L��I�I�l�#�#�#�#��	�	�%��.�.�!�!�!��&�&�t�y���&�F�F��#+�#8�#8�#:�#:� ��$���3�;�;��J�J�L�L�L��,�@�D�DK�M�M�O�O�DU� U�V�V�
V�	��;�'�'��1��5�5�D��4�y�y�8�#�#�!�-�0�0�0��
����,�,�,���	rWc��t|j|jf|j|j��|_|jr|���dSdS)z3Connect to the host and port specified in __init__.N)�socket_create_connectionr�r�r�r�r�r�rr�s rU�connectzHTTPConnection.connectQsP��,�d�i��	�-B�-1�\�4�;N�P�P��	���	��L�L�N�N�N�N�N�	�	rWc��|jr |j���d|_|jr |j���d|_t|_dS)z(Close the connection to the HTTP server.N)r�r�r�r�r�r�s rUr�zHTTPConnection.closeXsU���9�	��I�O�O�����D�I��?�	#��O�!�!�#�#�#�"�D�O�����rWc�H�|j�*|jr|���nt���|jdkrtdt
|����d}t|d��r�t|t��s�|jdkrtd��d}	|j
}d|vrd	}|jdkrtd
��n#t$rYnwxYw	|�|��}|sn2|r|�
d��}|j�|���JdS	|j�|��dS#t$rWt|t ��r"|D]}|j�|���YdStd
t#|��z���wxYw)z�Send `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:i r�zsendIng a read()ableFr�Tzencoding file using iso-8859-1rIraz9data should be a bytes-like object or an iterable, got %r)r��	auto_openrrrvr�r�r�r�r�mode�AttributeErrorr�r�sendall�	TypeErrorr�type)rOr��	blocksizerr�	datablock�ds       rUr
zHTTPConnection.sendbs���9���~�
%��������"�n�n�$��?�Q����'�4��:�:�&�&�&��	��4�� � �	��D�%�)@�)@�	����"�"��,�-�-�-��F�

@��y���d�?�?�!�F����*�*��>�?�?�?���"�
�
�
���
����
-� �I�I�i�0�0�	� ����?� )� 0� 0�� >� >�I��	�!�!�)�,�,�,�

-�
�F�	G��I���d�#�#�#�#�#���	G�	G�	G��$��)�)�
G��)�)�A��I�%�%�a�(�(�(�(�)�)�)� �!9�;?��:�:�!F�G�G�G�	G���s$�C�
C�C�$E�>F!� 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)r�rN)rOr�s  rU�_outputzHTTPConnection._output�s ��
	
����A�����rWc�h�|j�td��td��f��td���|j��}|jdd�=t	|t��r||z
}d}|�|��|�|�|��dSdS)z�Send 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.
        rWr_N)r��extendrrgr�r
)rO�message_bodyr|s   rU�_send_outputzHTTPConnection._send_output�s���	
����U�3�Z�Z��s���4�5�5�5��G�n�n�!�!�$�,�/�/���L����O��l�E�*�*�	 ��<��C��L��	�	�#�����#�
�I�I�l�#�#�#�#�#�$�#rWc�<�|jr |j���rd|_|jtkr
t|_nt|j���||_|sd}|�d|�d|j��}|�|�	d����|j
dk�ru|�sVd}|�d��rt|��\}}}}}|rS	|�	d��}n%#t$r|�	d��}YnwxYw|�d	|��n�	|j�	d��}	n*#t$r|j�	d��}	YnwxYw|j�d
��dkrt#d|	zd
z��}	|j|jkr|�d	|	��n5|	�d��}	|�d	|	�d
|j����|s|�dd��dSdSdS)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�/r�r	r�r��http�idna�HostrHr�[�]zAccept-Encoding�identity)r�r�r�r��_CS_REQ_STARTEDrr{�
_http_vsn_strr&r�	_http_vsnr�r�UnicodeEncodeError�	putheaderr�r�rr�rrh)
rOr�r��	skip_host�skip_accept_encoding�request�netloc�nil�
netloc_enc�host_encs
          rU�
putrequestzHTTPConnection.putrequest�sc���?�	#�t��7�7�9�9�	#�"�D�O�*�<�8�#�#�*�D�L�L�#�D�L�1�1�1�����	��C� &������T�-?�-?�@��	
���W�^�^�G�,�,�-�-�-��>�R����)
P����>�>�&�)�)�?�19�#���.�C���c�3��P�;�%+�]�]�7�%;�%;�
�
��-�;�;�;�%+�]�]�6�%:�%:�
�
�
�;�����N�N�6�:�6�6�6�6�<�#'�9�#3�#3�G�#<�#<����-�<�<�<�#'�9�#3�#3�F�#;�#;����<�����y�~�~�c�*�*�a�/�/�#(����4�)?�#@�#@���y�D�$5�5�5����v�x�8�8�8�8�#+�?�?�7�#;�#;�����v�(�(�(�D�I�I�/N�O�O�O�(�
>����0�*�=�=�=�=�=�
>�
>�
�Ds$�C/�/D�D�,E�$E.�-E.c�2�|jtkrt���t|d��r|�d��}t|��}t
|��D]h\}}t|d��r|�d��||<�.t|t��r%t|���d��||<�itd���|��}|td��z|z}|�|��dS)zkSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        rr	r
s
	s: N)
r�r3rr�rr��	enumerater�rr	rrgr&)rOr�valuesr��	one_valuer�s      rUr7zHTTPConnection.putheader$s	��
�<�?�*�*�"�$�$�$��6�8�$�$�	,��]�]�7�+�+�F��f����%�f�-�-�	;�	;�L�A�y��y�(�+�+�
;�%�,�,�Y�7�7��q�	�	��I�s�+�+�
;��	�N�N�1�1�'�:�:��q�	���i� � �%�%�f�-�-���%��,�,�&��.�����V�����rWc��|jtkr
t|_nt���|�|��dS)a�Indicate 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.  The message body will be sent in the same packet as the
        message headers if it is a string, otherwise it is sent as a separate
        packet.
        N)r�r3�_CS_REQ_SENTrr*)rOr)s  rU�
endheaderszHTTPConnection.endheaders8s@���<�?�*�*�'�D�L�L�"�$�$�$����,�'�'�'�'�'rWc�6�|�||||��dS)z&Send a complete request to the server.N)�
_send_request)rOr�r��bodyrms     rUr:zHTTPConnection.requestGs"�����6�3��g�6�6�6�6�6rWc�~�d}	tt|����}n�#t$ru}	ttj|�����j��}n1#ttf$r|j	dkrtd��YnwxYwYd}~nd}~wwxYw|�|�d|��dSdS)Nrz
Cannot stat!!zContent-Length)r	rKr �os�fstatr��st_sizer�OSErrorrvr�r7)rOrI�thelen�tes    rU�_set_content_lengthz"HTTPConnection._set_content_lengthKs�����		?���T���^�^�F�F���	?�	?�	?�
?��R�X�d�k�k�m�m�4�4�<�=�=����"�G�,�
?�
?�
?��?�Q�&�&��o�(>�(>�(>���
?�������������	?�������N�N�+�V�4�4�4�4�4��s2�!�
B �8A%�$B�%+B�B�B�B�B c��t�d�|D����}i}d|vrd|d<d|vrd|d<|j||fi|��|�d|vr|�|��|���D]\}}|�||���t
|t��r|�d��}|�	|��dS)	Nc�6�g|]}|�����Sr[)rJ)�.0�ks  rU�
<listcomp>z0HTTPConnection._send_request.<locals>.<listcomp>^s ��%A�%A�%A�A�a�g�g�i�i�%A�%A�%ArWr�rIr8zaccept-encodingr9r�ra)
�dict�fromkeysr?rQr�r7r�r	rrF)	rOr�r�rIrm�header_names�skipsr�r�s	         rUrHzHTTPConnection._send_request\s���}�}�%A�%A��%A�%A�%A�B�B�����\�!�!�!"�E�+����,�,�,-�E�(�)������-�-�u�-�-�-���!1��!E�!E��$�$�T�*�*�*�!�-�-�/�/�	'�	'�J�C���N�N�3��&�&�&�&��d�C� � �	-��;�;�|�,�,�D���������rWc��|jr |j���rd|_|jtks|jrt	|j���|jdkr(|�|j|j|j���}n!|�|j|j���}|�	��|j
tksJ�t|_|j
r|�
��n||_|S)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
        class 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)r�r�r�rErrvrr�r{r�r�r}r�r�)rOrs  rU�getresponsezHTTPConnection.getresponseqs����?�	#�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��������"�h�.�.�.�.������	'��J�J�L�L�L�L�'�D�O��rW)NNr�)rr)rXrYrZr5r4rr�	HTTP_PORTrrrvrwr�_GLOBAL_DEFAULT_TIMEOUTr�r�r�rrrr�r
r&r*r?r7rFr:rQrHr\r[rWrUrr�sm�������I��M�!�N��L��I��J�"&�/?��7��'�'�'�'�&)�)�)�)����( � � ����8��� � � �0G�0G�0G�d���$�$�$�$�*r�r�r�r�h���(
(�
(�
(�
(�)-�b�7�7�7�7�5�5�5�"���*5�5�5�5�5rWr)�
SSLContextc�D��eZdZdZeZdddeejdf�fd�	Z	d�Z
�xZS)�HTTPSConnectionz(This class allows communication via SSL.Nc����d|vr|d}	|d=nd}	d|vr|d}
|d=nd}
tt|���|||||��||_||_|
�8tjt
j��}
|
xjt
j	zc_|
j
t
jk}|	�|}	n|	r|std���|s|r|
�
||��|
|_|	|_dS)N�check_hostname�contextzMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED)r
rar��key_file�	cert_file�sslr_�PROTOCOL_SSLv23�options�OP_NO_SSLv2�verify_mode�	CERT_NONEr��load_cert_chain�_context�_check_hostname)
rOr�r�rerfr�r�r��_3to2kwargsrcrd�will_verifyr�s
            �rUr�zHTTPSConnection.__init__�sD��� �;�.�.��M]�A^��do�qA�eB�eB�#'�.��K�'�'�;�y�3I��{�[d�Oe�Oe� �'��/�4�(�(�1�1�$��f�g�2@�
B�
B�
B�$�D�M�&�D�N����.��)<�=�=�����3�?�2���!�-���>�K��%�!,����
J��
J� �"I�J�J�J��
=�9�
=��'�'�	�8�<�<�<�#�D�M�#1�D� � � rWc��t|j|jf|j|j��}|jr||_|���tj	r|jnd}|j
�||���|_	|jr3tj
|j���|j��dSdS#t$r?|j�t"j��|j����wxYw)z(Connect to a host on a given (SSL) port.N)�server_hostname)rr�r�r�r�r�r�rrg�HAS_SNIrn�wrap_socketro�match_hostname�getpeercert�	Exception�shutdownr�	SHUT_RDWRr�)rOr�rss   rUrzHTTPSConnection.connect�s��,�T�Y��	�,B�,0�L�$�:M�O�O�D�� �
� ��	�������+.�;�@�d�i�i�D�O��
�1�1�$�BQ�2�S�S�D�I�
��'�K��&�t�y�'<�'<�'>�'>��	�J�J�J�J�J�K�K���
�
�
��	�"�"�6�#3�4�4�4��	���!�!�!��
���s
�8B=�=A	D)rXrYrZ�__doc__�
HTTPS_PORTrrwrr^r�rr�r�s@rUrara�sk�������2�2�!��'+�T�T�,�f�6T�$(�	2�	2�	2�	2�	2�	2�4	�	�	�	�	�	�	rWrac��eZdZdS)rN�rXrYrZr[rWrUrrs������	�DrWrc��eZdZdS)rNr~r[rWrUrr
��������DrWrc��eZdZdS)rNr~r[rWrUrr
r�rWrc��eZdZd�ZdS)rc�$�|f|_||_dSr�)�argsr~)rOr~s  rUr�zUnknownProtocol.__init__s���H��	�����rWN�rXrYrZr�r[rWrUrrs#����������rWrc��eZdZdS)rNr~r[rWrUrrr�rWrc��eZdZdS)rNr~r[rWrUrrr�rWrc�"�eZdZdd�Zd�Zd�ZdS)rNc�2�|f|_||_||_dSr�)r��partial�expected)rOr�r�s   rUr�zIncompleteRead.__init__s���H��	���� ��
�
�
rWc�\�|j�d|jz}nd}dt|j��|fzS)Nz, %i more expectedr�zIncompleteRead(%i bytes read%s))r�rKr�)rO�es  rU�__repr__zIncompleteRead.__repr__ s7���=�$�$�t�}�4�A�A��A�0�C���4E�4E�q�3I�I�IrWc� �t|��Sr�)r�r�s rU�__str__zIncompleteRead.__str__&s���D�z�z�rWr�)rXrYrZr�r�r�r[rWrUrrsI������!�!�!�!�J�J�J�����rWrc��eZdZdS)rNr~r[rWrUrr)r�rWrc��eZdZdS)rNr~r[rWrUrr,r�rWrc��eZdZdS)rNr~r[rWrUrr/r�rWrc��eZdZdS)rNr~r[rWrUrr2r�rWrc��eZdZd�ZdS)rc�F�|st|��}|f|_||_dSr�)r�r�rTr�s  rUr�zBadStatusLine.__init__6s)���	���:�:�D��E��	���	�	�	rWNr�r[rWrUrr5s#����������rWrc��eZdZd�ZdS)rec�P�t�|dt|fz��dS)Nz&got more than %d bytes when reading %s)rr�rd)rO�	line_types  rUr�zLineTooLong.__init__=s6�����t�%M�(0�)�'<�&=�	>�	>�	>�	>�	>rWNr�r[rWrUrere<s#������>�>�>�>�>rWre){r{�
__future__rrrr�future.builtinsrrr	r
�future.utilsr�future.backports.emailrrir
�
email_message�future.backports.miscrr�iorKr�future.backports.urllib.parserrxr�collectionsr�collections.abc�__all__r]r|r}r�r3rEr��SWITCHING_PROTOCOLS�
PROCESSINGr=�CREATED�ACCEPTED�NON_AUTHORITATIVE_INFORMATIONr��
RESET_CONTENT�PARTIAL_CONTENT�MULTI_STATUS�IM_USED�MULTIPLE_CHOICES�MOVED_PERMANENTLY�FOUND�	SEE_OTHERr��	USE_PROXY�TEMPORARY_REDIRECT�BAD_REQUEST�UNAUTHORIZED�PAYMENT_REQUIRED�	FORBIDDEN�	NOT_FOUND�METHOD_NOT_ALLOWED�NOT_ACCEPTABLE�PROXY_AUTHENTICATION_REQUIRED�REQUEST_TIMEOUT�CONFLICT�GONE�LENGTH_REQUIRED�PRECONDITION_FAILED�REQUEST_ENTITY_TOO_LARGE�REQUEST_URI_TOO_LONG�UNSUPPORTED_MEDIA_TYPE�REQUESTED_RANGE_NOT_SATISFIABLE�EXPECTATION_FAILED�UNPROCESSABLE_ENTITY�LOCKED�FAILED_DEPENDENCY�UPGRADE_REQUIRED�PRECONDITION_REQUIRED�TOO_MANY_REQUESTS�REQUEST_HEADER_FIELDS_TOO_LARGE�INTERNAL_SERVER_ERROR�NOT_IMPLEMENTED�BAD_GATEWAY�SERVICE_UNAVAILABLE�GATEWAY_TIMEOUT�HTTP_VERSION_NOT_SUPPORTED�INSUFFICIENT_STORAGE�NOT_EXTENDED�NETWORK_AUTHENTICATION_REQUIREDr!r�rdrf�MessagerFro�objectrw�	RawIOBaserrrgr_rarN�ImportErrorrxrrrrrrrrrrrrrer r[rWrU�<module>r�s��D�D�L:�:�:�:�:�:�:�:�:�:�:�:�2�2�2�2�2�2�2�2�2�2�2�2�������9�9�9�9�9�9�;�;�;�;�;�;�O�O�O�O�O�O�	�	�	�	�	�	�	�	�
�
�
�
�2�2�2�2�2�2������������)�$�$�$�$�$�$�$�(�(�(�(�(�(�2�2�2��
�	�
�
�����#��������
�
�	��

���� #��
�
��
�����

���������	����	����������	��	����� #������
������������"%������	����������"%������������ ������"%��2
���2
��	�2
���	2
�
��2
���
2
��	(�2
���2
���2
��	�2
��	�2
��	�2
���2
���2
� ��!2
�"��#2
�$��%2
�&�	�'2
�2
�*��+2
�,��-2
�.�	�/2
�0��12
�2��32
�4�	�52
�6�	�72
�8�	(�92
�:�	�;2
�<��=2
�>��?2
�@�	�A2
�B�	�C2
�D�	#�E2
�F�	�G2
�H�	!�I2
�J�	*�K2
�2
�L
�	 �	�	*�	 �	�	�	�	�	%�	*�c2
�2
�2
�	�j
�	����������-�'����<)�@�@�@�@�0�6�8�8��Q�Q�Q�Q�Q�2�<�Q�Q�Q�fr�r�r�r�r�V�r�r�r�h
<&��J�J�J�������4�4�4�4�4�.�4�4�4�l�N�N�$�%�%�%�%��s�	�	�	��D�	����t	�	�	�	�	�I�	�	�	�
	�	�	�	�	�=�	�	�	�	�	�	�	�	��	�	�	������m����
	�	�	�	�	�m�	�	�	�	�	�	�	�	�M�	�	�	������]����	�	�	�	�	�m�	�	�	�	�	�	�	�	�/�	�	�	�	�	�	�	�	�.�	�	�	�	�	�	�	�	�.�	�	�	������M����>�>�>�>�>�-�>�>�>�	���s�
G�G�G

Hacked By AnonymousFox1.0, Coded By AnonymousFox