/usr/lib/python2.6/site-packages/urllib3/util
Edit: /usr/lib/python2.6/site-packages/urllib3/util/connection.pyc (3040B)
Ñò
;vVc @ s d d k Z y d d k l Z l Z WnI e j
o= e Z y d d k l Z Wqr e j
o
e Z qr Xn Xd „ Z e i d d d „ Z d „ Z
d S( iÿÿÿÿN( t pollt POLLIN( t selectc C sÚ t | d t ƒ } | t j o t S| d j o t St pH t p t Sy t | g g g d ƒ d SWq… t i j
o t SXn t ƒ } | i | t ƒ x5 | i d ƒ D]$ \ } } | | i
ƒ j o t Sq® Wd S( s
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.
t sockg i N( t getattrt Falset Nonet TrueR R t sockett errort registerR t fileno( t connR t pt fnot ev( ( s8 /tmp/pip-build-cD3xZi/urllib3/urllib3/util/connection.pyt is_connection_dropped s$
c C sR | \ } } | i d ƒ o | i d ƒ } n d } xð t i | | d t i ƒ D]Ó } | \ } } }
} } d }
yp t i | | |
ƒ }
t |
| ƒ | t i j o |
i | ƒ n | o |
i | ƒ n |
i
| ƒ |
SWqQ t i j
o0 } | } |
d j o |
i ƒ d }
q$qQ XqQ W| d j o
| ‚ n t i d ƒ ‚ d S( sd 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:`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.
t [s []i s! getaddrinfo returns an empty listN(
t
startswitht stripR R t getaddrinfot SOCK_STREAMt _set_socket_optionst _GLOBAL_DEFAULT_TIMEOUTt
settimeoutt bindt connectR t close( t addresst timeoutt source_addresst socket_optionst hostt portt errt rest aft socktypet protot canonnamet saR t e( ( s8 /tmp/pip-build-cD3xZi/urllib3/urllib3/util/connection.pyt create_connection0 s2
c C s4 | d j o d Sx | D] } | i | Œ q Wd S( N( R t
setsockopt( R t optionst opt( ( s8 /tmp/pip-build-cD3xZi/urllib3/urllib3/util/connection.pyR _ s
( R R R R t ImportErrorR R R R R* R ( ( ( s8 /tmp/pip-build-cD3xZi/urllib3/urllib3/util/connection.pyt
s $.