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: //usr/local/lib/python3.7/site-packages/urllib3/util/__pycache__/connection.cpython-37.pyc
B

���gn�@s�ddlmZddlZddlZddlmZddlmZmZej	ej
eeejee
ffZejrjddlmZdd	d
�dd�Zeddfd
ddddd�dd�Zdddd�dd�Zdd�dd�Zdd	d�dd �Zed!�ZdS)"�)�annotationsN�)�LocationParseError�)�_DEFAULT_TIMEOUT�
_TYPE_TIMEOUT)�BaseHTTPConnectionr�bool)�conn�returncCs|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�A/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py�is_connection_droppedsrztuple[str, int]rztuple[str, int] | Nonez_TYPE_SOCKET_OPTIONS | Nonez
socket.socket)�address�timeout�source_address�socket_optionsrcCs6|\}}|�d�r|�d�}d}t�}y|�d�Wn&tk
rZtd|�d��d�YnXx�t�|||tj�D]�}|\}	}
}}}
d}yJt�|	|
|�}t	||�|t
k	r�|�|�|r�|�|�|�
|
�d}|Stk
�r}z|}|dk	r�|��Wdd}~XYqpXqpW|dk	�r*z|�Wdd}Xntd��dS)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_connections>






r0�None)r.�optionsrcCs(|dkrdSx|D]}|j|�qWdS)N)�
setsockopt)r.r2�optrrr
r]s
rzsocket.AddressFamily)rcCstj}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
rgsr�str)r$rcCsVd}d}tjrFy"t�tj�}|�|df�d}Wntk
rDYnX|rR|��|S)z4Returns True if the system can bind an IPv6 address.NFrT)r�has_ipv6�AF_INET6r �	Exceptionr#)r$r.r9rrr
�	_has_ipv6rsr<z::1)�
__future__rr�typing�
exceptionsrrrr�Sequence�Tuple�int�Union�bytesZ_TYPE_SOCKET_OPTIONS�
TYPE_CHECKINGZ_base_connectionrrr0rrr<r6rrrr
�<module>s >