/usr/local/lib64/python3.6/site-packages/aiohttp/__pycache__
NameSizeModeActions
abc.cpython-36.pyc85280644editdlrm
base_protocol.cpython-36.pyc28240644editdlrm
client.cpython-36.pyc299650644editdlrm
client_exceptions.cpython-36.pyc113690644editdlrm
client_proto.cpython-36.pyc60410644editdlrm
client_reqrep.cpython-36.pyc277000644editdlrm
client_ws.cpython-36.pyc88240644editdlrm
connector.cpython-36.pyc352730644editdlrm
cookiejar.cpython-36.pyc108520644editdlrm
formdata.cpython-36.pyc44400644editdlrm
hdrs.cpython-36.pyc44730644editdlrm
helpers.cpython-36.pyc260370644editdlrm
http.cpython-36.pyc14220644editdlrm
http_exceptions.cpython-36.pyc43960644editdlrm
http_parser.cpython-36.pyc191820644editdlrm
http_websocket.cpython-36.pyc149420644editdlrm
http_writer.cpython-36.pyc54930644editdlrm
locks.cpython-36.pyc15820644editdlrm
log.cpython-36.pyc4230644editdlrm
multipart.cpython-36.pyc263120644editdlrm
payload.cpython-36.pyc134330644editdlrm
payload_streamer.cpython-36.pyc31820644editdlrm
pytest_plugin.cpython-36.pyc98700644editdlrm
resolver.cpython-36.pyc39400644editdlrm
streams.cpython-36.pyc186050644editdlrm
tcp_helpers.cpython-36.pyc10760644editdlrm
test_utils.cpython-36.pyc216670644editdlrm
tracing.cpython-36.pyc148570644editdlrm
typedefs.cpython-36.pyc14820644editdlrm
web.cpython-36.pyc107440644editdlrm
web_app.cpython-36.pyc151180644editdlrm
web_exceptions.cpython-36.pyc127660644editdlrm
web_fileresponse.cpython-36.pyc59350644editdlrm
web_log.cpython-36.pyc71820644editdlrm
web_middlewares.cpython-36.pyc38630644editdlrm
web_protocol.cpython-36.pyc157610644editdlrm
web_request.cpython-36.pyc238740644editdlrm
web_response.cpython-36.pyc210930644editdlrm
web_routedef.cpython-36.pyc79730644editdlrm
web_runner.cpython-36.pyc117550644editdlrm
web_server.cpython-36.pyc26810644editdlrm
web_urldispatcher.cpython-36.pyc422300644editdlrm
web_ws.cpython-36.pyc132810644editdlrm
worker.cpython-36.pyc69630644editdlrm
__init__.cpython-36.pyc42700644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/aiohttp/__pycache__/connector.cpython-36.pyc (35273B)
3 8%Eg @sRddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddl m Z ddl mZmZddlmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"ddl#Z#d d l$m%Z%m&Z&d d l'm(Z(d d l)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3d d l4m5Z5d dl6m7Z7m8Z8m9Z9d dl&m:Z:m;Z;mZ>m?Z?d dl@mAZAd dlBmCZCd dlDmEZEyddlFZFeFjGZGWneHk rdZFeIZGYnXd&ZJerd dlKmLZLd dl6mMZMd dlNmOZOGdddZPGdddZQGdddZRGd ddZSGd!d"d"ZTGd#ddeSZUGd$ddeSZVGd%ddeSZWdS)'N) defaultdictdeque)suppress) SimpleCookie)cycleislice) monotonic) TracebackType) TYPE_CHECKINGAny AwaitableCallable DefaultDictDictIteratorListOptionalSetTupleTypeUnioncast)hdrshelpers)AbstractResolver) ClientConnectionErrorClientConnectorCertificateErrorClientConnectorErrorClientConnectorSSLErrorClientHttpProxyErrorClientProxyConnectionErrorServerFingerprintMismatchUnixClientConnectorError cert_errors ssl_errors)ResponseHandler) ClientRequest Fingerprint_merge_ssl_params)PY_36 ceil_timeoutget_running_loop is_ip_addressnoopsentinel) RESPONSES)EventResultOrError)DefaultResolver BaseConnector TCPConnector UnixConnectorNamedPipeConnector) ClientTimeout) ConnectionKey)Tracec@s@eZdZd ZeeddddZeddd Zddd d ZdS) _DeprecationWaiter _awaitable_awaitedN) awaitablereturncCs||_d|_dS)NF)r;r<)selfr=r@=/usr/local/lib64/python3.6/site-packages/aiohttp/connector.py__init__Qsz_DeprecationWaiter.__init__)r>cCsd|_|jjS)NT)r<r; __await__)r?r@r@rArCUsz_DeprecationWaiter.__await__cCs|jstjdtdS)NzDConnector.close() is a coroutine, please use await connector.close())r<warningswarnDeprecationWarning)r?r@r@rA__del__Ysz_DeprecationWaiter.__del__)r;r<) __name__ __module__ __qualname__ __slots__r r rBrCrGr@r@r@rAr:Nsr:c@seZdZdZdZddeejddddZe ddd Z e fe dd d d Z eejdd dZeeejdddZeeedddZegdfddddZddddZddddZddddZeedddZdS) ConnectionNr3r8) connectorkeyprotocolloopr>cCs<||_||_||_||_g|_|jr8tjtj d|_ dS)Nr) _key _connector_loop _protocol _callbacks get_debug traceback extract_stacksys _getframe_source_traceback)r?rMrNrOrPr@r@rArBgszConnection.__init__)r>cCsd|jdS)Nz Connection<>)rQ)r?r@r@rA__repr__wszConnection.__repr__) _warningsr>cCs|jdk rtrd|i}ni}|jd|tf||jjr@dS|jj|j|jdd|dd}|j dk rt|j |d<|jj |dS)NsourcezUnclosed connection T) should_closezUnclosed connection)Zclient_connectionmessagesource_traceback) rTr*rEResourceWarningrS is_closedrR_releaserQr[call_exception_handler)r?r^kwargscontextr@r@rArGzs      zConnection.__del__cCstjdtdd|jS)Nz%connector.loop property is deprecated) stacklevel)rDrErFrS)r?r@r@rArPs zConnection.loopcCs|jdkrdS|jjS)N)rT transport)r?r@r@rArks zConnection.transportcCs|jS)N)rT)r?r@r@rArOszConnection.protocol)callbackr>cCs|dk r|jj|dS)N)rUappend)r?rlr@r@rA add_callbackszConnection.add_callbackc CsB|jddg}|_x&|D]}tt |WdQRXqWdS)N)rUr Exception)r? callbackscbr@r@rA_notify_releases  zConnection._notify_releasecCs2|j|jdk r.|jj|j|jddd|_dS)NT)r`)rrrTrRrerQ)r?r@r@rAcloses zConnection.closecCs6|j|jdk r2|jj|j|j|jjdd|_dS)N)r`)rrrTrRrerQr`)r?r@r@rAreleases  zConnection.releasecCs|jdkp|jj S)N)rT is_connected)r?r@r@rAclosedszConnection.closed)rHrIrJr[ _transportr&asyncioAbstractEventLooprBstrr]rDr rGpropertyrPr TransportrkrOr rnrrrsrtboolrvr@r@r@rArLbs*  rLc@seZdZdZddddZdS)_TransportPlaceholderz.placeholder for BaseConnector.connect functionN)r>cCsdS)Nr@)r?r@r@rArssz_TransportPlaceholder.close)rHrIrJ__doc__rsr@r@r@rAr~sr~c @seZdZdZdZdZdZeddddddee de fe e e e e ejdd d d Zefedd d dZddddZeddddZddddZdDe eee ee eddddZee dddZee dddZee dddZddd d!Zd"e dd#d$d%Z!ddd&d'Z"e#ddd(d)Z$ddd*d+Z%ee dd,d-Z&d"e d.d/d0Z'd1e(d2d3e)d4d5d6Z*d"e e d.d7d8Z+ddd9d:Z,d"e dd;dd"e e dd?d@dAZ.d1e(d2d3e d4dBdCZ/dS)Er3aBase connector class. keepalive_timeout - (optional) Keep-alive timeout. force_close - Set to True to force close and do reconnect after each request (and between redirects). limit - The total number of simultaneous connections. limit_per_host - Number of simultaneous connections to one host. enable_cleanup_closed - Enables clean-up closed ssl transports. Disabled by default. loop - Optional event loop. TNg@Fdr)keepalive_timeout force_closelimitlimit_per_hostenable_cleanup_closedrP)rrrrrrPr>cCs|r|dk r*|tk r*tdn |tkr*d}t|}d|_|jrRtjtjd|_ i|_ ||_ ||_ t |_tt |_tt||_||_tt|_||_tjt|d|_t|_d|_d|_| |_ g|_!|j"dS)Nz6keepalive_timeout cannot be set if force_close is Trueg.@Fr)rP)#r/ ValueErrorr,_closedrVrWrXrYrZr[_conns_limit_limit_per_hostset _acquiredr_acquired_per_hostrfloat_keepalive_timeout _force_closer_waitersrS functoolspartialr&_factoryrcookies_cleanup_handle_cleanup_closed_handle_cleanup_closed_disabled_cleanup_closed_transports_cleanup_closed)r?rrrrrrPr@r@rArBs4    zBaseConnector.__init__)r^r>cCs|jr dS|jsdSdd|jjD}|jtr>d|i}ni}|jd|tf|||dd}|jdk rx|j|d<|jj |dS)NcSsg|] }t|qSr@)repr).0cr@r@rA sz)BaseConnector.__del__..r_zUnclosed connector zUnclosed connector)rM connectionsrarb) rrvalues_closer*rErcr[rSrf)r?r^connsrgrhr@r@rArG s    zBaseConnector.__del__)r>cCstjdt|S)NzH"with Connector():" is deprecated, use "async with Connector():" instead)rDrErF)r?r@r@rA __enter__#szBaseConnector.__enter__)excr>cGs |jdS)N)r)r?rr@r@rA__exit__+szBaseConnector.__exit__cs|S)Nr@)r?r@r@rA __aenter__.szBaseConnector.__aenter__)exc_type exc_value exc_tracebackr>cs|jIdHdS)N)rs)r?rrrr@r@rA __aexit__1szBaseConnector.__aexit__cCs|jS)z1Ultimately close connection on releasing if True.)r)r?r@r@rAr9szBaseConnector.force_closecCs|jS)zThe total number for simultaneous connections. If limit is 0 the connector has no limit. The default limit size is 100. )r)r?r@r@rAr>szBaseConnector.limitcCs|jS)zThe limit for simultaneous connections to the same endpoint. Endpoints are the same if they are have equal (host, port, is_ssl) triple. )r)r?r@r@rArGszBaseConnector.limit_per_hostc Cs|jr|jjd|_|jj}|j}|jri}||}x|jjD]\}}g}x|D]~\}} |jr| |dkr|j} |j |j r|j r|j j | q|j || fqV|j} |j |j rV|j rV|j j | qVW|rD|||<qDW||_|jr tj|d||j|_dS)zCleanup unused transports.Nr_cleanup)rcancelrStimerritemsrurkrsis_sslrrrmrweakref_handle) r?nowtimeoutrdeadlinerNraliveprotoZuse_timerkr@r@rArPs8    zBaseConnector._cleanupr8)rNvalr>cCs4|j}||krdS||}|j||s0|j|=dS)N)rremove)r?rNrZacquired_per_hostrr@r@rA_drop_acquired_per_hostys z%BaseConnector._drop_acquired_per_hostcCsV|jr|jjx|jD]}|dk r|jqWg|_|jsRtj|d|j|j|_dS)z~Double confirmation for transport close. Some broken ssl servers may leave socket open without proper close. Nr) rrrabortrrr_cleanup_closed_periodrS)r?rkr@r@rArs   zBaseConnector._cleanup_closedcCs|jttS)zClose all opened transports.)rr:r.)r?r@r@rArsszBaseConnector.closec Cs|jr dSd|_z|jjr dS|jr0|jj|jr@|jjx,|jjD]}x|D]\}}|jqVWqLWx|j D] }|jqvWx|j D]}|dk r|j qWWd|jj |j j |j j d|_|j j d|_XdS)NT)rrSrdrrrrrrsrrrclearr)r?datart0rkr@r@rArs0          zBaseConnector._closecCs|jS)z;Is connector closed. A readonly property. )r)r?r@r@rArvszBaseConnector.closed)rNr>cCs|jrV|jt|j}|jr|dkr||jkr|jj|}|dk sFt|jt|}n<|jr||jkr|jj|}|dk s~t|jt|}nd}|S)z Return number of available connections. The limit, limit_per_host and the connection key are taken into account. If it returns less than 1 means that there are no connections available. rNr)rlenrrrgetAssertionError)r?rN availableZacquiredr@r@rA_available_connectionss      z$BaseConnector._available_connectionsr'r9r7)reqtracesrr>c 's|j}|j|}|dks$||jkr|jj}|j|j||r^x|D]}|jIdHqHWzny|IdHWnZtk r}z>||jkry|j|j|Wnt k rYnX|WYdd}~XnXWd||jkr|j| r|j|=X|rx|D]}|j IdHqW|j |} | dkr(t t t} |jj| |j|j| |rpx|D]}|jIdHqXWy0|j|||IdH} |jr| jtdWn@tk r|js|jj| |j|| |jYn"X|js|jj| |j|| |rx|D]}|jIdHqWnd|rt t t} |jj| |j|j| x|D]}|jIdHq\W|jj| |j|| |jj| |j|j| t||| |jS)z'Get from pool or create new connection.rNzConnector is closed.)connection_keyrrrS create_futurermZsend_connection_queued_start BaseExceptionrrZsend_connection_queued_end_getrr&r~raddrZsend_connection_create_start_create_connectionrrsrr_release_waiterZsend_connection_create_endZsend_connection_reuseconnrL) r?rrrrNrfuttraceer placeholderr@r@rAconnectst                       zBaseConnector.connectc Csy|j|}Wntk r"dSX|jj}x|r|j\}}|jr|||jkr|j}|j|j r|j r|j j |q|s|j|=|Sq0|j}|j|j r0|j r0|j j |q0W|j|=dS)N) rKeyErrorrSrpoprurrkrsrrrrm)r?rNrt1rrrkr@r@rAr=s,  zBaseConnector._getcCsv|js dSt|jj}tj|xN|D]F}|j|dkrc CsH|jr dSy|jj||j||Wntk r:Yn X|jdS)N)rrrrrr)r?rNrr@r@rA_release_acquiredvs zBaseConnector._release_acquired)r`)rNrOr`r>cCs|jr dS|j|||jr d}|s*|jrT|j}|j|jr|j r|jj |nV|j j |}|dkrvg}|j |<|j ||j j f|jdkrtj|d|j|j |_dS)NTr)rrrr`rkrsrrrrmrrrSrrrrr)r?rNrOr`rkrr@r@rAres"    zBaseConnector._releasecs tdS)N)NotImplementedError)r?rrrr@r@rArsz BaseConnector._create_connection)NNN)0rHrIrJrrr[rr/robjectrr}intrrxryrBrDr rGrrrrrr rr{rrrrr&rrr rsrrvrrrLrrrrrerr@r@r@rAr3sV ",* %" Q  c@seZdZdeeddddZeedddZe e e fe e e efddd d Ze e e fdd d d ZddddZe e e fe e e efd ddZe e e fed ddZdS)_DNSCacheTableN)ttlr>cCsi|_i|_||_dS)N) _addrs_rr _timestamps_ttl)r?rr@r@rArBsz_DNSCacheTable.__init__)hostr>cCs ||jkS)N)r)r?rr@r@rA __contains__sz_DNSCacheTable.__contains__)rNaddrsr>cCs,t|t|f|j|<|jr(t|j|<dS)N)rrrrrr)r?rNrr@r@rArsz_DNSCacheTable.add)rNr>cCs&|jj|d|jr"|jj|ddS)N)rrrr)r?rNr@r@rArsz_DNSCacheTable.remove)r>cCs|jj|jjdS)N)rrr)r?r@r@rArs z_DNSCacheTable.clearcCs(|j|\}}tt||}t||S)N)rrrnext)r?rNrPlengthrr@r@rA next_addrssz_DNSCacheTable.next_addrscCs$|jdkrdS|j||jtkS)NF)rrr)r?rNr@r@rAexpireds z_DNSCacheTable.expired)N)rHrIrJrrrBrr}rrrzrrrr rrrrrr@r@r@rArs&$rcs`eZdZdZdddddddddeddddddeeeeeeeee e dee e fee e efeee deefeeeeeejdfd d Zedd fd d Zeed ddZeed ddZdr4a/TCP connector. verify_ssl - Set to True to check ssl certifications. fingerprint - Pass the binary sha256 digest of the expected certificate in DER format to verify that the certificate the server presents matches. See also https://en.wikipedia.org/wiki/Transport_Layer_Security#Certificate_pinning resolver - Enable DNS lookups and use this resolver use_dns_cache - Use memory cache for DNS lookups. ttl_dns_cache - Max seconds having cached a DNS entry, None forever. family - socket address family local_addr - local tuple of (host, port) to bind socket to keepalive_timeout - (optional) Keep-alive timeout. force_close - Set to True to force close and do reconnect after each request (and between redirects). limit - The total number of simultaneous connections. limit_per_host - Number of simultaneous connections to one host. enable_cleanup_closed - Enables clean-up closed ssl transports. Disabled by default. loop - Optional event loop. TN rFr) verify_ssl fingerprint use_dns_cache ttl_dns_cachefamily ssl_contextssl local_addrresolverrrrrrrPcsjtj| | | | ||dt|||||_| dkrcs&x|jjD] }|jq WtjS)zClose all ongoing DNS calls.)rrrrrs)r?Zev)rr@rArss zTCPConnector.closecCs|jS)zSocket family like AF_INET.)r)r?r@r@rArszTCPConnector.familycCs|jS)z%True if local DNS caching is enabled.)r)r?r@r@rArszTCPConnector.use_dns_cache)rportr>cCsJ|dk r"|dk r"|jj||fn$|dk s2|dk rc s:t|r||||jdddgS|js|rFx|D]}|j|IdHq.W|jj|||jdIdH}|rx|D]}|j|IdHqjW|S||f}||jkr|jj| r|jj |}|rx|D]}|j |IdHqW|S||j kr$|j |}|rx|D]}|j |IdHqW|j IdHn t |j|j |<|rZx|D]}|j|IdHq@Wzy|rx|D]}|j|IdHqjW|jj|||jdIdH} |rx|D]}|j|IdHqW|jj|| |j |jWn8tk r} z|j |j| dWYdd} ~ XnXWd|j j|X|jj |S)Nr)hostnamerrrrflags)r)r)r-rrZsend_dns_resolvehost_startrresolveZsend_dns_resolvehost_endrrrZsend_dns_cache_hitrwaitr1rSZsend_dns_cache_missrrrr) r?rrrrresrNresulteventrrr@r@rA _resolve_host/s`           zTCPConnector._resolve_hostr'r7)rrrr>cs<|jr |j|||IdH\}}n|j|||IdH\}}|S)zcCreate connection. Has same keyword arguments as BaseEventLoop.create_connection. N)proxy_create_proxy_connection_create_direct_connection)r?rrr_rr@r@rAr{szTCPConnector._create_connection)verifiedr>cCs|r tjStjtj}|jtjO_|jtjO_d|_tj|_ y|jtj O_Wn2t k r}zt j dj|WYdd}~XnX|j|SdS)NFz{!s}: The Python interpreter is compiled against OpenSSL < 1.0.0. Ref: https://docs.python.org/3/library/ssl.html#ssl.OP_NO_COMPRESSION)rcreate_default_context SSLContextPROTOCOL_TLS_CLIENToptions OP_NO_SSLv2 OP_NO_SSLv3check_hostname CERT_NONE verify_modeOP_NO_COMPRESSIONAttributeErrorrDrEformatset_default_verify_paths)r sslcontextZattr_errr@r@rA_make_ssl_contexts zTCPConnector._make_ssl_context)rr>cCsz|jrrtdkrtd|j}t|tjr.|S|dk r@|jdS|j}t|tjrV|S|dk rh|jdS|jdSdSdS)a*Logic to get the correct SSL context 0. if req.ssl is false, return None 1. if ssl_context is specified in req, use it 2. if _ssl_context is specified in self, use it 3. otherwise: 1. if verify_ssl is not specified in req, use self.ssl_context (will generate a default context according to self.verify_ssl) 2. if verify_ssl is True in req, generate a default SSL context 3. if verify_ssl is False in req, generate a SSL context that won't verify NzSSL is not supported.FT)rr RuntimeError isinstancerrr)r?rrr@r@rA_get_ssl_contexts     zTCPConnector._get_ssl_contextr(cCs,|j}t|tr|S|j}t|tr(|SdS)N)rr r(r)r?rretr@r@rA_get_fingerprints  zTCPConnector._get_fingerprint) client_error)argsrrr$rgr>csy8t|j4IdH|jj||IdHSQIdHRXWntk rh}zt|j||WYdd}~Xnvtk r}zt|j||WYdd}~XnHt k r}z,|j dkrt |t j r||j||WYdd}~XnXdS)N)r+ sock_connectrScreate_connectionr$rrr%rOSErrorerrnor rx TimeoutError)r?rrr$r%rgrr@r@rA_wrap_create_connections$z$TCPConnector._wrap_create_connectioncCs8|js dS|j}|dk st|jdkr,dS|jdS)aWRaise a :py:exc:`RuntimeError` on missing ``start_tls()``. One case is that :py:meth:`asyncio.loop.start_tls` is not yet implemented under Python 3.6. It is necessary for TLS-in-TLS so that it is possible to send HTTPS queries through HTTPS proxies. This doesn't affect regular HTTP requests, though. Nhttps)rr rscheme_check_loop_for_start_tls)r?r proxy_urlr@r@rA_fail_on_no_start_tlss   z"TCPConnector._fail_on_no_start_tlscCs>y |jjWn,tk r8}ztd|WYdd}~XnXdS)NaAn HTTPS request is being sent through an HTTPS proxy. This needs support for TLS in TLS but it is not implemented in your runtime for the stdlib asyncio. Please upgrade to Python 3.7 or higher. For more details, please see: * https://bugs.python.org/issue37179 * https://github.com/python/cpython/pull/28073 * https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support * https://github.com/aio-libs/aiohttp/discussions/6044 )rS start_tlsrr)r?Zattr_excr@r@rAr.s   z&TCPConnector._check_loop_for_start_tlsc Cs*y |jWntk r dSXdSdS)NFT)r.r)r?r@r@rA_loop_supports_start_tlss  z%TCPConnector._loop_supports_start_tls)underlying_transportrr>cCs<|jjjdkrdSt|dd}|r&dStjdt|dddS)z6Issue a warning if the requested URL has HTTPS scheme.r,NZ_start_tls_compatibleFaAn HTTPS request is being sent through an HTTPS proxy. This support for TLS in TLS is known to be disabled in the stdlib asyncio. This is why you'll probably see an error in the log below. It is possible to enable it via monkeypatching under Python 3.7 or higher. For more details, see: * https://bugs.python.org/issue37179 * https://github.com/python/cpython/pull/28073 You can temporarily patch this as follows: * https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support * https://github.com/aio-libs/aiohttp/discussions/6044 )r_rj) request_infourlr-getattrrDrERuntimeWarning)r?r3rZasyncio_supports_tls_in_tlsr@r@rA_warn_about_tls_in_tls s z#TCPConnector._warn_about_tls_in_tls)r3rrr$r>c s|j}ttj|j|}ynt|j4IdHJy$|jj||||j |j dIdH}Wnt k rr|j YnXWdQIdHRXWnt k r}zt|j||WYdd}~Xntk r}zt|j||WYdd}~Xntk r4}z0|jdkrt|tjr||j||WYdd}~Xntk r} z@td|j d|jdd|jd|jpndd | d | WYdd} ~ Xn*X|dkrd } ||jt| |j|||fS) z$Wrap the raw TCP transport with TLS.N)server_hostnameZssl_handshake_timeoutz2Cannot initialize a TLS-in-TLS connection to host :dz4 through an underlying connection to an HTTPS proxy z ssl:defaultz []z:Failed to start TLS (possibly caused by closing transport))rrrrr!r+r&rSr1rtotalrrsr$rrr%rr(r)r rxr* TypeErrorrrr connection_made) r?r3rrr$Z tls_protorZ tls_transportrZtype_errmsgr@r@rA_start_tls_connection/s@ 4 z"TCPConnector._start_tls_connection)rrrr$r>c-s|j|}|j|}|jj}|dk s(t|j}|dk s:ttj|j|||d|j d} ytj | IdH} Wnxtj k rddddd} | j | YnHt k r} z,| jdkrt| tjrĂt|j| | WYdd} ~ XnXd} x| D]}|d}|d}yN|j|j|||||d |d |d |r6|d nd|j||d IdH\}}Wn*tk r|} z | } wWYdd} ~ XnX|jr|ry|j|WnFtk r} z(|j|js|jj|| } wWYdd} ~ XnX||fSW| dk st| dS)N)r)rPz$asyncio.Future[List[Dict[str, Any]]])rr>c Ss$tttj|jWdQRXdS)N)rrorxCancelledErrorr)rr@r@rAdrop_exceptionsz>TCPConnector._create_direct_connection..drop_exceptionrrrrrr) rrrrrr:rrr$)r!r#r6Zraw_hostrrrx ensure_futurer rSshieldrDadd_done_callbackr(r)r r*rrr+rrrcheckr"rsrrrm)r?rrrr$rrrrZ host_resolvedhostsrErlast_excZhinfotransprr@r@rAr msf         z&TCPConnector._create_direct_connectionc$s|j||j}i}|jdk r&|j}|jtj|tj<|j}|dk sJtttj |||j |j |j d}|j |g|tdIdH\}} | j|jjtjd} | dk r|js| |jtj<n | |jtj<|jr|r|j||tj|_|j|_tj|jdddd} t|| | |j } |j| IdH} zdy4| j}|dk s|j!X|sp|j,|}|j-|j.||||j/|d IdHS|j0|||d IdHSWd| j!X|| fS) N)headersauthrPr)r$)r  proxy_authZproxy_headers_hash)Zread_until_eofr)statusrarMsocket)r=z)Transport does not expose socket instance)rrsockr:r)rr)1r0r2 proxy_headersrMrZHOSTr rr'ZMETH_GETrOrSrr r!rrZ AUTHORIZATIONrZPROXY_AUTHORIZATIONr9Z METH_CONNECTmethodr6attrZevolverrLsendrTZset_response_paramsstartrrsrwrQreasonr0r r5historyget_extra_infordupr!r+rrrC)r?rrrZruntime_has_start_tlsrMr6Z proxy_reqrkrrNrNconnZ proxy_resprOresprarawsockrr@r@rAr s                  z%TCPConnector._create_proxy_connection)NN)N)4rHrIrJrr/r}rbytesrrrr(rrzrrrrxryrBr rsr{rrrrrr r r&r staticmethodr lru_cacherr!r#rrror|r+r0r.r2r9 BaseTransportrCr r  __classcell__r@r@)rrAr4s^l K  !  &>H c sxeZdZdZdedddfeeeee dfe e e e j ddfdd Zeed d d Zd ed dedddZZS)r5aUnix socket connector. path - Unix socket path. keepalive_timeout - (optional) Keep-alive timeout. force_close - Set to True to force close and do reconnect after each request (and between redirects). limit - The total number of simultaneous connections. limit_per_host - Number of simultaneous connections to one host. loop - Optional event loop. FrrN)pathrrrrrPr>cs tj|||||d||_dS)N)rrrrrP)rrB_path)r?rerrrrrP)rr@rArBIs zUnixConnector.__init__)r>cCs|jS)zPath to unix socket.)rf)r?r@r@rAre[szUnixConnector.pathr'r9r7)rrrr>csyDt|j4IdH"|jj|j|jIdH\}}WdQIdHRXWnLtk r}z0|jdkrnt|t j rnt |j |j ||WYdd}~XnXtt|S)N)r+r&rScreate_unix_connectionrrfr(r)r rxr*r#rerrr&)r?rrrrrrr@r@rAr`s*$z UnixConnector._create_connection)rHrIrJrr/rzr}rrrrrrxryrBr{rerr&rrdr@r@)rrAr5=s    c sxeZdZdZdedddfeeeee dfe e e e j ddfdd Zeed d d Zd ed dedddZZS)r6aNamed pipe connector. Only supported by the proactor event loop. See also: https://docs.python.org/3.7/library/asyncio-eventloop.html path - Windows named pipe path. keepalive_timeout - (optional) Keep-alive timeout. force_close - Set to True to force close and do reconnect after each request (and between redirects). limit - The total number of simultaneous connections. limit_per_host - Number of simultaneous connections to one host. loop - Optional event loop. FrrN)rerrrrrPr>cs6tj|||||dt|jtjs,td||_dS)N)rrrrrPz9Named Pipes only available in proactor loop under windows)rrBr rSrxZProactorEventLooprrf)r?rerrrrrP)rr@rArBs  zNamedPipeConnector.__init__)r>cCs|jS)zPath to the named pipe.)rf)r?r@r@rAreszNamedPipeConnector.pathr'r9r7)rrrr>csyTt|j4IdH2|jj|j|jIdH\}}tjdIdHWdQIdHRXWnHtk r}z,|j dkr~t |tj r~t |j ||WYdd}~XnXtt|S)Nr)r+r&rSZcreate_pipe_connectionrrfrxsleepr(r)r r*rrrr&)r?rrrrrrr@r@rArs$ z%NamedPipeConnector._create_connection)rHrIrJrr/rzr}rrrrrrxryrBr{rerr&rrdr@r@)rrAr6ps   )r3r4r5r6)XrxrrrYrWrD collectionsrr contextlibr http.cookiesr itertoolsrrrrtypesr typingr r r r rrrrrrrrrrrVrrabcrZclient_exceptionsrrrrr r!r"r#r$r%Z client_protor&Z client_reqrepr'r(r)r*r+r,r-r.r/httpr0locksr1rr2rr ImportErrorr__all__clientr7r8Ztracingr9r:rLr~r3rr4r5r6r@r@r@rAs`    @ 0          Zl'n3