\h%ddlmZddlZddlmZddlmZddlmZddl m Z m Z d Z ejddfd Zd Zd Zd ZedZy))absolute_importN)_appengine_environ)LocationParseError)six)NoWayToWaitForSocketError wait_for_readcft|dd}|dury|y t|dS#t$rYywxYw)a$ Returns True if the connection is dropped and should be closed. :param conn: :class:`http.client.HTTPConnection` object. Note: For platforms like AppEngine, this will always return ``False`` to let the platform handle connection recycling transparently for us. sockFTg)timeout)getattrr r )connr s f/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/connection.pyis_connection_droppedr sH 4 'D u} |T3// $s $ 00c|\}}|jdr|jd}d}t} |jdtj|||tjD]z}|\} } } } } d} tj| | | }t|||tjur|j||r|j||j| |cS||tj d#t$r%t j td|zdcYSwxYw#tj $r }|}||j#d}Yd}~d}~wwxYw)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[]Nidnaz'%s', label empty or too longz!getaddrinfo returns an empty list) startswithstripallowed_gai_familyencode UnicodeErrorr raise_fromrsocket getaddrinfo SOCK_STREAM_set_socket_options_GLOBAL_DEFAULT_TIMEOUT settimeoutbindconnecterrorclose)addressr source_addresssocket_optionshostporterrfamilyresafsocktypeproto canonnamesar es rcreate_connectionr3%s^$JD$ szz$ C  !F  F !!$ff6H6HI-0*HeY ==Xu5D n 5f<<<( .) LL K,  ,,: ;;=  ~~ ?$F G   *|| C   s*D:A+D3+D0/D03E&E!!E&c6|y|D]}|j|y)N) setsockopt)r optionsopts rrrds'cRtj}trtj}|S)zThis 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.)rAF_INETHAS_IPV6 AF_UNSPEC)r+s rrrls ^^F!! Mr8c d}d}tjrytjr9 tjtj}|j |dfd}|r|j|S#t $rYwxYw)z4Returns True if the system can bind an IPv6 address.NFrT)ris_appengine_sandboxrhas_ipv6AF_INET6r! Exceptionr$)r(r r?s r _has_ipv6rBwsw DH ..0   ==1D IItQi H  O    s8A77 BBz::1) __future__rrcontribr exceptionsrpackagesrwaitr r rrr3rrrBr;r8rrIsN& (+:8  * * <<~< U r8