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: //opt/osm/venv/lib/python3.10/site-packages/urllib3/util/__pycache__/connection.cpython-310.pyc
o

<i\�@s�ddlmZddlZddlZddlmZddlmZmZe	e
eeejee
ffZejr3ddlmZd&dd
�Zeddfd'dd�Zd(dd�Zd)dd �Zd*d#d$�Zed%�ZdS)+�)�annotationsN�)�LocationParseError�)�_DEFAULT_TIMEOUT�
_TYPE_TIMEOUT)�BaseHTTPConnection�connr�return�boolcCs|jS)z�
    Returns True if the connection is dropped and should be closed.
    :param conn: :class:`urllib3.connection.HTTPConnection` object.
    )Zis_connected)r	�r�E/opt/osm/venv/lib/python3.10/site-packages/urllib3/util/connection.py�is_connection_droppedsr�address�tuple[str, int]�timeoutr�source_address�tuple[str, int] | None�socket_options�_TYPE_SOCKET_OPTIONS | None�
socket.socketcCs$|\}}|�d�r|�d�}d}t�}z|�d�Wnty*td|�d��d�wt�|||tj�D]O}|\}	}
}}}
d}z(t�|	|
|�}t	||�|t
urU|�|�|r\|�|�|�
|
�d}|WSty�}z|}|dury|��WYd}~q4d}~ww|dur�z|�d}wtd��)akConnect 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:`socket.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[]N�idna�'z', label empty or too longz!getaddrinfo returns an empty list)�
startswith�strip�allowed_gai_family�encode�UnicodeErrorr�socket�getaddrinfo�SOCK_STREAM�_set_socket_optionsr�
settimeout�bind�connect�OSError�close)rrrr�host�port�err�family�res�af�socktype�proto�	canonname�sa�sock�_rrr
�create_connectionsD

�




��r4r2�options�NonecCs$|durdS|D]}|j|�qdS)N)�
setsockopt)r2r5�optrrr
r"]s
�r"�socket.AddressFamilycCstj}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.)r�AF_INET�HAS_IPV6�	AF_UNSPEC)r+rrr
rgsrr(�strcCsTd}d}tjr"zt�tj�}|�|df�d}Wn	ty!Ynw|r(|��|S)z4Returns True if the system can bind an IPv6 address.NFrT)r�has_ipv6�AF_INET6r$�	Exceptionr')r(r2r>rrr
�	_has_ipv6rs�rAz::1)r	rr
r)
rrrrrrrrr
r)r2rr5rr
r6)r
r9)r(r=r
r)�
__future__rr�typing�
exceptionsrrrr�list�tuple�int�Union�bytesZ_TYPE_SOCKET_OPTIONS�
TYPE_CHECKINGZ_base_connectionrrr4r"rrAr;rrrr
�<module>s"
�
B