
    q"h%                         S SK Jr  S SKrSSKJr  SSKJr  SSKJr  SSK	J
r
Jr  S	 r\R                  SS4S
 jrS rS rS r\" S5      rg)    )absolute_importN   )_appengine_environ)LocationParseError)six   )NoWayToWaitForSocketErrorwait_for_readc                 f    [        U SS5      nUSL a  gUc  g [        USS9$ ! [         a     gf = f)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     U/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/urllib3/util/connection.pyis_connection_droppedr      sH     4'Du}|T3//$ s   	# 
00c                     U u  pEUR                  S5      (       a  UR                  S5      nSn[        5       n UR                  S5        [        R                  " XEU[        R                  5       H}  nUu  ppnSn [        R                  " XU5      n[        X5        U[        R                  La  UR                  U5        U(       a  UR                  U5        UR                  U5        Us  $    Ub  Ue[        R                   " S5      e! [         a&    [
        R                  " [        SU-  5      S5      s $ f = f! [        R                    a*  nUnUb  UR#                  5         Sn SnAGM   SnAGM  SnAff = f)aG  Connect 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idnaz'%s', label empty or too longz!getaddrinfo returns an empty list)
startswithstripallowed_gai_familyencodeUnicodeErrorr   
raise_fromr   socketgetaddrinfoSOCK_STREAM_set_socket_options_GLOBAL_DEFAULT_TIMEOUT
settimeoutbindconnecterrorclose)addressr   source_addresssocket_optionshostporterrfamilyresafsocktypeproto	canonnamesar   es                   r   create_connectionr3   %   sU   $ JDszz$
C
  !F
F !!$ff6H6HI-0*e	==u5D  5f<<<(		.)LLK J, 	
,,:
;;=  
~~?$FG
 	

* || 	C

  	s*   D <A0D?-D<;D<?E=E88E=c                 <    Uc  g U H  nU R                   " U6   M     g )N)
setsockopt)r   optionsopts      r   r   r   d   s          c                  \    [         R                  n [        (       a  [         R                  n U $ )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.)r   AF_INETHAS_IPV6	AF_UNSPEC)r+   s    r   r   r   l   s"    
 ^^Fx!!Mr8   c                 0   SnSn[         R                  " 5       (       a  g[        R                  (       a:   [        R                  " [        R                  5      nUR                  U S45        SnU(       a  UR                  5         U$ ! [         a     N%f = f)z4Returns True if the system can bind an IPv6 address.NFr   T)r   is_appengine_sandboxr   has_ipv6AF_INET6r!   	Exceptionr$   )r(   r   r?   s      r   	_has_ipv6rB   w   sz    DH ..00	==1DIItQi H 

O  		s   9B 
BBz::1)
__future__r   r   contribr   
exceptionsr   packagesr   waitr	   r
   r   r   r3   r   r   rB   r;    r8   r   <module>rI      sN    &  ( +  :8 **	<<~< Ur8   