HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.9/site-packages/pip/_vendor/urllib3/util/__pycache__/connection.cpython-39.pyc
a

?�f�@snddlmZddlZddlmZmZddlmZdd�Zej	ddfd	d
�Z
dd�Zd
d�Zdd�Z
e
d�ZdS)�)�absolute_importN�)�NoWayToWaitForSocketError�
wait_for_read�)�_appengine_environcCsLt|dd�}|durdS|dur$dSzt|dd�WStyFYdS0dS)a 
    Returns True if the connection is dropped and should be closed.

    :param conn:
        :class:`httplib.HTTPConnection` object.

    Note: For platforms like AppEngine, this will always return ``False`` to
    let the platform handle connection recycling transparently for us.
    �sockFNTg)�timeout)�getattrrr)Zconnr�r�G/usr/lib/python3.9/site-packages/pip/_vendor/urllib3/util/connection.py�is_connection_droppeds
r
cCs�|\}}|�d�r|�d�}d}t�}t�|||tj�D]�}|\}	}
}}}
d}zNt�|	|
|�}t||�|tjur||�|�|r�|�	|�|�
|
�|WStjy�}z$|}|dur�|��d}WYd}~q8d}~00q8|dur�|�t�d��dS)adConnect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    An host of '' or port 0 tells the OS to use the default.
    �[z[]Nz!getaddrinfo returns an empty list)
�
startswith�strip�allowed_gai_family�socketZgetaddrinfoZSOCK_STREAM�_set_socket_options�_GLOBAL_DEFAULT_TIMEOUTZ
settimeout�bindZconnect�error�close)Zaddressr	Zsource_addressZsocket_options�host�port�err�family�resZafZsocktype�protoZ	canonnameZsar�errr�create_connection!s2







rcCs$|durdS|D]}|j|�qdS)N)Z
setsockopt)r�options�optrrrrYsrcCstj}trtj}|S)z�This function is designed to work in the context of
    getaddrinfo, where family=socket.AF_UNSPEC is the default and
    will perform a DNS search for both IPv6 and IPv4 records.)rZAF_INET�HAS_IPV6Z	AF_UNSPEC)rrrrrasrcCs`d}d}t��rdStjrPz"t�tj�}|�|df�d}WntyNYn0|r\|��|S)z6 Returns True if the system can bind an IPv6 address. NFrT)rZis_appengine_sandboxr�has_ipv6ZAF_INET6r�	Exceptionr)rrr#rrr�	_has_ipv6lsr%z::1)Z
__future__rr�waitrrZcontribrr
rrrrr%r"rrrr�<module>s�
8