%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core/17212/usr/lib/python3/dist-packages/urllib3/util/__pycache__/
Upload File :
Create Path :
Current File : //snap/core/17212/usr/lib/python3/dist-packages/urllib3/util/__pycache__/connection.cpython-35.pyc



R/oV4
�@s�ddlmZddlZyddlmZmZWnGek
rdZyddlmZWnek
rzdZYnXYnXdd�Zejdddd	�Z	d
d�Z
dS)�)�absolute_importN)�poll�POLLINF)�selectcCs�t|dd�}|dkr"dS|dkr2dSts|tsBdSyt|gggd�dSWntjk
r{dSYnXt�}|j|t�x3|jd�D]"\}}||j�kr�dSq�WdS)a 
    Returns True if the connection is dropped and should be closed.

    :param conn:
        :class:`httplib.HTTPConnection` object.

    Note: For platforms like AppEngine, this will always return ``False`` to
    let the platform handle connection recycling transparently for us.
    �sockFNTgr)�getattrrr�socket�error�registerr�fileno)Zconnr�pZfnoZev�r
�9/usr/lib/python3/dist-packages/urllib3/util/connection.py�is_connection_dropped
s"
		rcCsI|\}}|jd�r*|jd�}d}x�tj||dtj�D]�}|\}}	}
}}d}
yftj||	|
�}
t|
|�|tjk	r�|
j|�|r�|
j|�|
j	|�|
SWqLtj
k
r}z'|}|
dk	r
|
j�d}
WYdd}~XqLXqLW|dk	r6|�tj
d��dS)adConnect 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:`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[]Nrz!getaddrinfo returns an empty list)�
startswith�striprZgetaddrinfoZSOCK_STREAM�_set_socket_options�_GLOBAL_DEFAULT_TIMEOUTZ
settimeoutZbindZconnectr	�close)ZaddressZtimeoutZsource_addressZsocket_options�hostZport�err�resZafZsocktype�protoZ	canonnameZsar�er
r
r�create_connection1s0"




rcCs2|dkrdSx|D]}|j|�qWdS)N)Z
setsockopt)rZoptionsZoptr
r
rr`s
r)Z
__future__rrrrr�ImportErrorrrrrr
r
r
r�<module>s

$.

Zerion Mini Shell 1.0