403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/tornado/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/tornado/__pycache__/tcpclient.cpython-311.pyc
�

��b,/����dZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddl
mZddlmZddlmZdd	lmZmZmZmZmZmZmZmZmZd
ZGd�de��ZGd
�de��Z dS)z'A non-blocking TCP connection factory.
�N)�Future�future_add_done_callback)�IOLoop)�IOStream)�gen)�Resolver)�TimeoutError)	�Any�Union�Dict�Tuple�List�Callable�Iterator�Optional�Setg333333�?c
��eZdZdZdeedeejegee	dffddfd�Z
edeedeeeejefeeejefffd���Ze
dfd	ed
eeeejfddfd�Zd
eeejefddfd�Zd
eeejefdejdeddddf
d�Zd	eddfd�Zdd�Zdd�Zd
eeejfddfd�Zdd�Zdd�Zdd�ZdS)�
_Connectora�A stateless implementation of the "Happy Eyeballs" algorithm.

    "Happy Eyeballs" is documented in RFC6555 as the recommended practice
    for when both IPv4 and IPv6 addresses are available.

    In this implementation, we partition the addresses by family, and
    make the first connection attempt to whichever address was
    returned first by ``getaddrinfo``.  If that connection fails or
    times out, we begin a connection in parallel to the first address
    of the other family.  If there are additional failures we retry
    with other addresses, keeping one connection attempt per family
    in flight at a time.

    http://tools.ietf.org/html/rfc6555

    �addrinfo�connect�Future[IOStream]�returnNc�&�tj��|_||_t	��|_d|_d|_d|_t|��|_
|�|��\|_|_
t��|_dS�N)r�current�io_looprr�future�timeout�connect_timeout�
last_error�len�	remaining�split�
primary_addrs�secondary_addrs�set�streams)�selfrrs   �3/usr/lib/python3/dist-packages/tornado/tcpclient.py�__init__z_Connector.__init__7sz���~�'�'������
�H�H�	
�����#�������X�����37�:�:�h�3G�3G�0���D�0��u�u�����c��g}g}|dd}|D]:\}}||kr|�||f���#|�||f���;||fS)a�Partition the ``addrinfo`` list by address family.

        Returns two lists.  The first list contains the first entry from
        ``addrinfo`` and all others with the same family, and the
        second list contains all other addresses (normally one list will
        be AF_INET and the other AF_INET6, although non-standard resolvers
        may return additional families).
        r)�append)r�primary�	secondary�
primary_af�af�addrs      r)r#z_Connector.splitKsx�����	��a�[��^�
� �	-�	-�H�B���Z�������D�z�*�*�*�*�� � �"�d��,�,�,�,��	�!�!r+rrz2Future[Tuple[socket.AddressFamily, Any, IOStream]]c��|�t|j����|�|��|�|�|��|jSr)�try_connect�iterr$�set_timeout�set_connect_timeoutr)r(rrs   r)�startz_Connector.startdsY��
	
����d�0�1�1�2�2�2�����!�!�!��&��$�$�_�5�5�5��{�r+�addrsc	��	t|��\}}nc#t$rV|jdkrG|j���s.|j�|jptd����YdSwxYw|�||��\}}|j	�
|��t|tj
|j|||����dS)Nrzconnection failed)�next�
StopIterationr"r�done�
set_exceptionr �IOErrorrr'�addr�	functools�partial�on_connect_done)r(r9r1r2�streamrs      r)r4z_Connector.try_connectos���
	��E�{�{�H�B�����	�	�	��~��"�"�4�;�+;�+;�+=�+=�"���)�)��O�C�w�/B�'C�'C����
�F�F�	�������b�$�/�/��������� � � � ��I�%�d�&:�E�2�t�L�L�	
�	
�	
�	
�	
s��AA5�4A5r1r2rc��|xjdzc_	|���}n�#t$r�}|j���rYd}~dS||_|�|��|j�3|j�	|j��|�
��Yd}~dSd}~wwxYw|���|j���r|���dS|j
�|��|j�|||f��|���dS)N�)r"�result�	Exceptionrr=r r4rr�remove_timeout�
on_timeout�clear_timeouts�closer'�discard�
set_result�
close_streams)r(r9r1r2rrD�es       r)rCz_Connector.on_connect_done�sL��	
���!����	��]�]�_�_�F�F���	�	�	��{���!�!�
������� �D�O����U�#�#�#��|�'���+�+�D�L�9�9�9����!�!�!��F�F�F�F�F�����	����	
�������;�����	!��L�L�N�N�N�N�N��L� � ��(�(�(��K�"�"�B��f�#5�6�6�6���� � � � � s�'�
B1�B,�AB,�,B1c��|j�|j���|z|j��|_dSr)r�add_timeout�timerJr)r(rs  r)r6z_Connector.set_timeout�s9���|�/�/��L�����'�)�4�?�
�
����r+c��d|_|j���s)|�t	|j����dSdSr)rrr=r4r5r%�r(s r)rJz_Connector.on_timeout�sN������{���!�!�	9����T�$�"6�7�7�8�8�8�8�8�	9�	9r+c�V�|j�!|j�|j��dSdSr)rrrIrUs r)�
clear_timeoutz_Connector.clear_timeout�s0���<�#��L�'�'���5�5�5�5�5�$�#r+c�P�|j�||j��|_dSr)rrR�on_connect_timeoutr)r(rs  r)r7z_Connector.set_connect_timeout�s,�� $�|�7�7��T�4� 
� 
����r+c��|j���s&|j�t����|���dSr)rr=r>r	rOrUs r)rYz_Connector.on_connect_timeout�sJ���{���!�!�	6��K�%�%�l�n�n�5�5�5��������r+c��|j�|j�|j��|j�!|j�|j��dSdSr)rrrIrrUs r)rKz_Connector.clear_timeouts�sR���<�#��L�'�'���5�5�5���+��L�'�'��(<�=�=�=�=�=�,�+r+c�B�|jD]}|����dSr)r'rL)r(rDs  r)rOz_Connector.close_streams�s,���l�	�	�F��L�L�N�N�N�N�	�	r+�rN)�__name__�
__module__�__qualname__�__doc__rr
r�socket�
AddressFamilyrr*�staticmethodr#�_INITIAL_CONNECT_TIMEOUT�floatrr�datetime�	timedeltar8rr4rCr6rJrWr7rYrKrO�r+r)rr%so��������"��u�+���
�
!�5�)�5��;M�1M�+N�N�
��
�
����(�"��u�+�"�	��U�6�'��.�
/�0��U�6�'��.�
/�0�	2�
�"�"�"��\�"�42�FJ�	�	��	�"�%��x�/A�(A�"B�C�	�
>�		�	�	�	�
��%��0D�e�0K�*L�!M�
�RV�
�
�
�
�$!���f�2�E�9�:�;�!�
� �!��	!�
#�!�
�
!�!�!�!�@
�5�
�T�
�
�
�
�
9�9�9�9�
6�6�6�6�
�$�U�H�,>�%>�?�
�	
�
�
�
�
�����
>�>�>�>������r+rc�^�eZdZdZddeeddfd�Zdd�Zej	dddddfde
ded	ejd
ee
ee
efejfdeedee
d
eedee
eejfdefd�Z		dded	ejdedee
d
eedeedffd�ZdS)�	TCPClientz�A non-blocking TCP connection factory.

    .. versionchanged:: 5.0
       The ``io_loop`` argument (deprecated since version 4.1) has been removed.
    N�resolverrc�^�|�||_d|_dSt��|_d|_dS)NFT)rl�
_own_resolverr)r(rls  r)r*zTCPClient.__init__�s6����$�D�M�!&�D����$�J�J�D�M�!%�D���r+c�J�|jr|j���dSdSr)rnrlrLrUs r)rLzTCPClient.close�s1����	"��M���!�!�!�!�!�	"�	"r+�host�portr1�ssl_options�max_buffer_size�	source_ip�source_portrc		��TK�|��t|tj��r)tj�����|z}ngt|tj��r;tj�����|���z}ntd|z���|�6tj||j�
|||�����d{V��}	n"|j�
|||���d{V��}	t|	tj|j|||�����}
|
�|����d{V��\}}}|�R|�2tj||�d||������d{V��}n|�d||����d{V��}|S)a�Connect to the given host and port.

        Asynchronously returns an `.IOStream` (or `.SSLIOStream` if
        ``ssl_options`` is not None).

        Using the ``source_ip`` kwarg, one can specify the source
        IP address to use when establishing the connection.
        In case the user needs to resolve and
        use a specific interface, it has to be handled outside
        of Tornado as this depends very much on the platform.

        Raises `TimeoutError` if the input future does not complete before
        ``timeout``, which may be specified in any form allowed by
        `.IOLoop.add_timeout` (i.e. a `datetime.timedelta` or an absolute time
        relative to `.IOLoop.time`)

        Similarly, when the user requires a certain source port, it can
        be specified using the ``source_port`` arg.

        .. versionchanged:: 4.5
           Added the ``source_ip`` and ``source_port`` arguments.

        .. versionchanged:: 5.0
           Added the ``timeout`` argument.
        NzUnsupported timeout %r)rtru)rF)rr�server_hostname)�
isinstance�numbers�RealrrrSrgrh�
total_seconds�	TypeErrorr�with_timeoutrl�resolverrArB�_create_streamr8�	start_tls)
r(rprqr1rrrsrtrurr�	connectorr2rDs
             r)rzTCPClient.connect�s&����H���'�7�<�0�0�
D� �.�*�*�/�/�1�1�G�;����G�X�%7�8�8�
D� �.�*�*�/�/�1�1�G�4I�4I�4K�4K�K���� 8�7� B�C�C�C��� �-����.�.�t�T�2�>�>���������H�H�"�]�2�2�4��r�B�B�B�B�B�B�B�B�H������#��#�'�	
�
�
�
�
�	�"+�����!I�!I�I�I�I�I�I�I���D�&��"��"�"�/���$�$��;��%��� � ��������� &�/�/��{�D� 0� � ���������
r+r2rc���t|t��r|nd}|}|r|s|tjkrdnd}tj|��}|s|rA	|�||f��n(#tj$r|����wxYw	t||���}	|	|	�|��fS#tj$r1}
t��}|�
|
��|	|fcYd}
~
Sd}
~
wwxYw)Nrz::1z	127.0.0.1)rs)rx�intrb�AF_INET6�bind�errorrLrrrr>)r(rsr1r2rtru�source_port_bind�source_ip_bind�
socket_objrDrP�fus            r)rzTCPClient._create_stream%sE��+5�[�#�*F�*F�M�;�;�A��"���	M�I�	M�')�F�O�&;�&;�U�U��N��]�2�&�&�
��	�~�	�
�����1A� B�C�C�C�C���<�
�
�
�� � �"�"�"��
����	0��j�/�J�J�J�F��6�>�>�$�/�/�/�/���|�	�	�	����B����Q�����2�:�����������	���s*�
A%�%%B
�B6�6C6�&C1�+C6�1C6rr])NN)r^r_r`rarrr*rLrb�	AF_UNSPEC�strr�rcrrr
�ssl�
SSLContextrfrgrhrrr
rrir+r)rkrk�s���������&�&��(�!3�&�t�&�&�&�&�"�"�"�"�$*�#3�GK�)-�#'�%)�>B�J�J��J��J�
� �	J�
�e�D��c��N�C�N�$B�C�D�J�"�#��
J��C�=�J��c�]�J��%��x�'9� 9�:�;�J�
�J�J�J�J�b$(�%)�
#0�#0��#0�
� �#0��	#0�
�C�=�#0��c�]�
#0�
�x�+�+�	,�#0�#0�#0�#0�#0�#0r+rk)!rarArbryrgr��tornado.concurrentrr�tornado.ioloopr�tornado.iostreamr�tornador�tornado.netutilr�tornado.genr	�typingr
rrr
rrrrrre�objectrrkrir+r)�<module>r�sl�� ������
�
�
�
���������
�
�
�
�?�?�?�?�?�?�?�?�!�!�!�!�!�!�%�%�%�%�%�%�������$�$�$�$�$�$�$�$�$�$�$�$�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S���^�^�^�^�^��^�^�^�BB0�B0�B0�B0�B0��B0�B0�B0�B0�B0r+

Youez - 2016 - github.com/yon3zu
LinuXploit