ó _XîTc@s™ddlZyddlmZmZWnEek rmeZyddlmZWqnek rieZqnXnXd„Zejddd„Z d„Z dS(iÿÿÿÿN(tpolltPOLLIN(tselectcCsÎt|dtƒ}|tkr"tS|dkr2tSts{tsBtSyt|gggdƒdSWq{tjk rwtSXntƒ}|j|t ƒx3|jdƒD]"\}}||j ƒkr¤tSq¤WdS(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. tsockgiN( tgetattrtFalsetNonetTrueRRtsocketterrortregisterRtfileno(tconnRtptfnotev((s;/usr/lib/python2.7/site-packages/urllib3/util/connection.pytis_connection_dropped s"    cCs%|\}}d}xètj||dtjƒD]Ë}|\}} } } } d} yltj|| | ƒ} t| |ƒ|tjk r“| j|ƒn|r©| j|ƒn| j| ƒ| SWq.tj k rø}|}| dk rù| j ƒd} qùq.Xq.W|dk r|‚ntj dƒ‚dS(sdConnect 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. is!getaddrinfo returns an empty listN( RRt getaddrinfot SOCK_STREAMt_set_socket_optionst_GLOBAL_DEFAULT_TIMEOUTt settimeouttbindtconnectR tclose(taddressttimeouttsource_addresstsocket_optionsthosttportterrtrestaftsocktypetprotot canonnametsaRt_((s;/usr/lib/python2.7/site-packages/urllib3/util/connection.pytcreate_connection0s, "      cCs2|dkrdSx|D]}|j|ŒqWdS(N(Rt setsockopt(Rtoptionstopt((s;/usr/lib/python2.7/site-packages/urllib3/util/connection.pyR]s  ( RRRRt ImportErrorRRRRR'R(((s;/usr/lib/python2.7/site-packages/urllib3/util/connection.pyts    $,