� ���g\����ddlmZddlZddlZddlmZddlmZmZe e e e ej e e ffZejrddlmZd!d �Zeddfd"d�Zd#d�Zd$d�Zd%d�Zed ��ZdS)&�)� annotationsN�)�LocationParseError�)�_DEFAULT_TIMEOUT� _TYPE_TIMEOUT)�BaseHTTPConnection�connr �return�boolc��|j S)z� Returns True if the connection is dropped and should be closed. :param conn: :class:`urllib3.connection.HTTPConnection` object. )� is_connected)r s �g/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/urllib3/util/connection.py�is_connection_droppedrs�� � � � ��address�tuple[str, int]�timeoutr�source_address�tuple[str, int] | None�socket_options�_TYPE_SOCKET_OPTIONS | None� socket.socketc���|\}}|�d��r|�d��}d}t��} |�d��n"#t$rt d|�d���d�wxYwt j|||t j��D]�}|\} } } } } d} t j| | | ��}t||��|tur|� |��|r|� |��|� | ��d}|cS#t$r"}|}|�|���Yd}~��d}~wwxYw|� |�#d}wxYwtd���)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�_s r�create_connectionr8s���$�J�D�$� ���s��� ��z�z�$���� �C�  � !� !�F�Q� � � �F������ �Q�Q�Q� �!E�T�!E�!E�!E�F�F�D�P�Q�����!�$��f�f�6H�I�I����-0�*��H�e�Y���� ��=��X�u�5�5�D� ��n� 5� 5� 5��.�.�.�����(�(�(�� *�� � �.�)�)�)� �L�L�� � � ��C��K�K�K��� � � ��C���� � � � � ���������� ����  �� ��I���C�J�J�J�J��9�:�:�:s1�A�A6�'A3D� E �'E�E �E�Er6�options�Nonec�,�|�dS|D] }|j|�� dS)N)� setsockopt)r6r9�opts rr&r&]s9������������������r�socket.AddressFamilyc�D�tj}tr tj}|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/s rr r gs �� �^�F��"��!�� �Mrr,�strc���d}d}tjrI tjtj��}|�|df��d}n#t$rYnwxYw|r|���|S)z4Returns True if the system can bind an IPv6 address.NFrT)r#�has_ipv6�AF_INET6r(� Exceptionr+)r,r6rEs r� _has_ipv6rHrs��� �D��H� �� �  ��=���1�1�D� �I�I�t�Q�i� � � ��H�H��� � � � �D� ���� �� � � � � � � �Os�7A � A�Az::1)r r r r ) rrrrrrrrr r)r6rr9rr r:)r r>)r,rCr r )� __future__rr#�typing� exceptionsrrrr�list�tuple�int�Union�bytes�_TYPE_SOCKET_OPTIONS� TYPE_CHECKING�_base_connectionr rr8r&r rHrA�rr�<module>rUs��"�"�"�"�"�"� � � � � � � � �+�+�+�+�+�+�4�4�4�4�4�4�4�4��E�#�s�F�L��e��,D�"D�E�F�� ��6�5�5�5�5�5�5�!�!�!�!�.�-1�26� ?;�?;�?;�?;�?;�D������������. �9�U� � ���r
Memory