Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
connector.cpython-313.pyc456 linesDownload Raw Back to __pycache__
1�

2��j���V�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJrJ	r	J3r4 SSKJr SSK
Jr SSKJrJrJr SSKJr SSKJr SSKJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r( SSK)r)SS	K)J*r*J+r+ S5SK,J-r-J.r. S6SK/J0r0J1r1 S7S
K2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r= S8SK>J?r? S9SK@JArAJBrBJCrC S10SK.JDrDJErEJFrFJGrGJHrHJIrIJJrJ S11SKKJLrL S12SKMJNrN \R�S:�aSSKPJQrQ O	\'\R\SSS4rQ\(aSSKTrT\TR�rUOSSKTrT\TR�rU\X"S15rY\X"SS15rZ\X"SS15r[\Z\Y-r\\\\[-r]S\R�s=:*=(a S:Os =(d \R�S:r^Sr_\(aS13S K`Jara S14S!K@Jbrb S15S"KcJdrd "S#S$5reS%\ \\WS&S4S'jrf"S(S)5rg"S*S+\g5rh"S,S-5ri"S.S/5rj"S0S15rkS2\lS&\U4S3jrm\m"S45rn\m"S55ro"S6S7\j5rp"S8S9\j5rq"S:S;\j5rrg!\Va SrT\WrUGNf=f)<�N)�OrderedDict�defaultdict�deque)�suppress)�16HTTPStatus)�chain�cycle�islice)�	monotonic)�
TracebackType)�
TYPE_CHECKING�Any�	Awaitable�Callable�DefaultDict�Deque�Dict�Iterator�List�Literal�Optional�Sequence�Set�Tuple�Type�Union�cast)�AddrInfoType�SocketFactoryType�)�hdrs�helpers)�AbstractResolver�
ResolveResult)�ClientConnectionError�ClientConnectorCertificateError�ClientConnectorDNSError�ClientConnectorError�ClientConnectorSSLError�ClientHttpProxyError�ClientProxyConnectionError�ServerFingerprintMismatch�UnixClientConnectorError�cert_errors�17ssl_errors)�ResponseHandler)�
ClientRequest�Fingerprint�_merge_ssl_params)�	_SENTINEL�ceil_timeout�
is_ip_address�noop�sentinel�
set_exception�18set_result)�
client_logger)�DefaultResolver���)�Bufferzmemoryview[int]zmemoryview[bytes]��http�https�ws�wss)r>�
r)r>rFr )r>r?�)�
BaseConnector�TCPConnector�
UnixConnector�NamedPipeConnectorrr)�
ClientTimeout)�
ConnectionKey)�Tracec�H�\rSrSrSrS\\SS4SjrS\4SjrS	Sjr	Sr19g)20�_DeprecationWaiter�t��21_awaitable�_awaited�	awaitable�returnNc��XlSUlg�NFrR)�selfrUs  �WD:\code\apps\devtools\python\user_packages\Python313\site-packages\aiohttp/connector.py�__init__�_DeprecationWaiter.__init__ws��#����
�c�D�SUlURR5$)NT)rTrS�	__await__�rYs rZr_�_DeprecationWaiter.__await__{s����
����(�(�*�*r]c�^�UR(d[R"S[5 gg)NzDConnector.close() is a coroutine, please use await connector.close())rT�warnings�warn�DeprecationWarningr`s rZ�__del__�_DeprecationWaiter.__del__s"���}�}��M�M�5�"�
�r]�rVN)�__name__�22__module__�__qualname__�__firstlineno__�	__slots__rrr[r_rf�__static_attributes__�r]rZrPrPts/��*�I��)�C�.��T��+�3�+�r]rP�waitersrVc��# �[R"USS06IShv�NnUH1n[U[5(dM[R23"SU5 M3 gN<7f)z'Wait for all waiters to finish closing.�return_exceptionsTNz!Error while closing connector: %r)�asyncio�gather�24isinstance�	Exceptionr;�debug)rp�results�ress   rZ�_wait_for_closerz�sI����N�N�G�D�t�D�D�G����c�9�%�%���� C�S�I��E�s�A�A�A�Ac25�R�\rSrSrSrSSSSS\S\RS	S426S27jrS	\	4Sjr28\4S\S	S4S
jjr
S	\S4Sjr\S	\R4Sj5r\S	\\R&4Sj5r\S	\\4Sj5rS\/S4S	S4SjrSSjrSSjrSSjr\S	\4Sj5rSrg)�29Connection�N�	connectorrH�keyrM�protocol�looprVc���X lXlX@lX0l/UlUR5(a0[R"[R"S55Ul30gg)Nr )�_key�31_connector�_loop�	_protocol�32_callbacks�	get_debug�	traceback�
extract_stack�sys�	_getframe�_source_traceback)rYr~rr�r�s     rZr[�Connection.__init__�sM���	�#���33�4<��46����>�>���%.�%<�%<�S�]�]�1�=M�%N�D�"�r]c�"�SURS3$)NzConnection<�>)r�r`s rZ�__repr__�Connection.__repr__�s���T�Y�Y�K�q�)�)r]�	_warningsc�v�URb�SU0nUR"SU<3[40UD6 URR	5(agUR34R
URURSS9 USS.nURbURUS'URRU5 gg)N�sourcezUnclosed connection T��should_closezUnclosed connection)�client_connection�message�source_traceback)35r�rd�ResourceWarningr��	is_closedr��_releaser�r��call_exception_handler)rYr��kwargs�contexts    rZrf�Connection.__del__�s����>�>�%���%�F��N�N�1�$��:�O�V�v�V��z�z�#�#�%�%���O�O�$�$�T�Y�Y����T�$�R�,0�=R�S�G��%�%�1�.2�.D�.D��*�+��J�J�-�-�g�6�&r]Tc��g)z9Force subclasses to not be falsy, to make checks simpler.Tror`s rZ�__bool__�Connection.__bool__�s��r]c�N�[R"S[SS9 UR$)Nz%connector.loop property is deprecated���36stacklevel)rcrdrer�r`s rZr��Connection.loop�s#���
�
�3�5G�TU�	37��z�z�r]c�J�URcgURR$�N)r��	transportr`s rZr��Connection.transport�s���>�>�!���~�~�'�'�'r]c��UR$r�)r�r`s rZr��Connection.protocol�s���~�~�r]�callbackc�B�UbURRU5 ggr�)r��append)rYr�s  rZ�add_callback�Connection.add_callback�s�����O�O�"�"�8�,� r]c��URSS/solUH"n[[5 U"5 SSS5 M$ g!,(df   M6=fr�)r�rrv)rY�	callbacks�cbs   rZ�_notify_release�Connection._notify_release�s=��%)�_�_�Q�%7��"�	�?��B��)�$���%�$��$�$�s�A�38A	c��UR5 URb7URRURURSS9 SUlgg)NTr��r�r�r�r�r�r`s rZ�close�Connection.close�sE�������>�>�%��O�O�$�$�T�Y�Y����T�$�R�!�D�N�&r]c��UR5 URb8URRURUR5 SUlggr�r�r`s rZ�release�Connection.release�s@�������>�>�%��O�O�$�$�T�Y�Y����?�!�D�N�&r]c�j�URSL=(d URR5(+$r�)r��is_connectedr`s rZ�closed�Connection.closed�s&���~�~��%�J�T�^�^�-H�-H�-J�)J�Jr])r�r�r�r�r�r�rh)rirjrkrlr�r0rs�AbstractEventLoopr[�strr�rcrrfrr��propertyr�r�	Transportr�r�rr�r�r�r��boolr�rnror]rZr|r|�s-����O�"�O��O�"�	O�39�'�'�O�40�
O� *�#�*�(0�7��7�D�7��'�$�-����g�/�/�����(�8�G�$5�$5�6�(��(�41��(�?�3����-�X�b�$�h�%7�-�D�-��"�"��K��K��Kr]r|c�"�\rSrSrSrSSjrSrg)�_ConnectTunnelConnection��a�Special connection wrapper for CONNECT tunnels that must never be pooled.42 43This connection wraps the proxy connection that will be upgraded with TLS.44It must never be released to the pool because:451. Its 'closed' future will never complete, causing session.close() to hang462. It represents an intermediate state, not a reusable connection473. The real connection (with TLS) will be created separately48Nc��g)a9Do nothing - don't pool or close the connection.49 50These connections are an intermediate state during the CONNECT tunnel51setup and will be cleaned up naturally after the TLS upgrade. If they52were to be pooled, they would never be properly closed, causing53session.close() to wait forever for their 'closed' future.54Nror`s rZr�� _ConnectTunnelConnection.release���r]rorh)rirjrkrl�__doc__r�rnror]rZr�r��s���r]r�c�b�\rSrSrSrSrS\R\\	SS4Sjr55S56SjrS57S	jrSr
g)�_TransportPlaceholder��z.placeholder for BaseConnector.connect function�r�r��
closed_futurerVNc��XlSUlg)z)Initialize a placeholder for a transport.Nr�)rYr�s  rZr[�_TransportPlaceholder.__init__s��#����r]c��g)zClose the placeholder.Nror`s rZr��_TransportPlaceholder.closer�r]c��g)z%Abort the placeholder (does nothing).Nror`s rZ�abort�_TransportPlaceholder.abort	r�r]rh)rirjrkrlr�rmrs�Futurerrvr[r�r�rnror]rZr�r��s5��8�'�I��g�n�n�X�i�5H�&I��d��58%�4r]r�c��\rSrSrSrSrSrSr\r	\59SSSSSS	S60.S\\S\
4S\S
\S\S\S\\R$S\
SS4Sjjr\4S\SS4SjjrS=SjrS\SS4SjrS=SjrS>S\\\S\\S\\SS4Sjjr\S\4Sj5r\S\4Sj5r \S\4S j5r!S?S!jr"S?S"jr#SS#.S$\S\$S4S%jjr%SS#.S$\S\&\$\4S&jjr'\S\4S'j5r(S(S)S\4S*jr)S+\*S\*4S,jr+S+\*S-\&S.S/S0S\,4S1jr-S(S)S-\&S.SS4S2jr.S(S)S-\&S.S\\,4S3jr/S?S4jr0S(S)S5\1SS4S6jr2SS7.S(S)S8\1S9\SS4S:jjr3S+\*S-\&S.S/S0S\14S;jr4S<r5g)@rHi
a0Base connector class.61 62keepalive_timeout - (optional) Keep-alive timeout.63force_close - Set to True to force close and do reconnect64    after each request (and between redirects).65limit - The total number of simultaneous connections.66limit_per_host - Number of simultaneous connections to one host.67enable_cleanup_closed - Enables clean-up closed ssl transports.68                        Disabled by default.69timeout_ceil_threshold - Trigger ceiling of timeout values when70                         it's above timeout_ceil_threshold.71loop - Optional event loop.72TNg@F�dr���keepalive_timeout�force_close�limit�limit_per_host�enable_cleanup_closedr��timeout_ceil_thresholdr�r�r�r�r�r�r�rVc��U(aUbU[La[S5eOU[LaSnU=(d [R"5nXplSUlUR
5(a/[R"[R"S55Ul[[5UlX0lX@l[#5Ul[["5Ul[)[*U5UlX l[[05UlX`l[6R8"[:US9UlSUlSUl U(a8[B(d-[DRF"S[RH3[JSS9 SnU(+Ul&/Ul'URQ5Ul)URRRUS5 URW5 g)	Nz6keepalive_timeout cannot be set if force_close is Trueg.@Fr �r�zoenable_cleanup_closed ignored because https://github.com/python/cpython/pull/118960 is fixed in Python version r�r�),r8�73ValueErrorrs�get_running_loop�_timeout_ceil_threshold�_closedr�r�r�r�r�r�rr�_conns�_limit�_limit_per_host�set�	_acquired�_acquired_per_hostr�float�_keepalive_timeout�_force_closer�_waitersr��	functools�partialr0�_factory�_cleanup_handle�_cleanup_closed_handle�NEEDS_CLEANUP_CLOSEDrcrd�version_infore�_cleanup_closed_disabled�_cleanup_closed_transports�
create_future�_placeholder_futurer:�_cleanup_closed)rYr�r�r�r�r�r�r�s        rZr[�BaseConnector.__init__$s���� �,�1B�(�1R� �L����!�H�,�$(�!��1�w�/�/�1��'=�$�����>�>���%.�%<�%<�S�]�]�1�=M�%N�D�"�
���	
����-��/2�u������	
��#'�u�.?�"@���'��
��$�	
�
��74�!�)�)�/��E��
�?C���FJ��#� �)=�)=��M�M�%�%(�%5�%5�$6�8�#��
�%*�!�,A�(A��%�MO��'���� �	
� �	
� � �+�+�D�1����r]r�c��UR(agUR(dgURR5Vs/sHn[U5PM nnUR	5 SU0nUR75"SU<3[40UD6 UUSS.nURbURUS'URRU5 gs snf)Nr�zUnclosed connector zUnclosed connector)r~�connectionsr�r�)76r�r��values�repr�_closerdr�r�r�r�)rYr��c�connsr�r�s      rZrf�BaseConnector.__del__qs����<�<���{�{��"&�+�+�"4�"4�"6�7�"6�Q��a��"6��7����
��D�!�����,�T�H�5��Q�&�Q�� �+�77��78�!�!�-�*.�*@�*@�G�&�'��79�80�)�)�'�2��8s�Cc�<�[R"S[5 U$)NzH"with Connector():" is deprecated, use "async with Connector():" instead)rcrdrer`s rZ�	__enter__�BaseConnector.__enter__�s���
�
�
4��	81�82�r]�excc�$�UR5 gr�)r	)rYrs  rZ�__exit__�BaseConnector.__exit__�s�����
r]c��# �U$7fr�ror`s rZ�83__aenter__�BaseConnector.__aenter__�s84�����s��exc_type�	exc_value�
exc_tracebackc��@# �UR5IShv�N gN7fr�)r�)rYrrrs    rZ�	__aexit__�BaseConnector.__aexit__�s����j�j�l���s���c��UR$)z1Ultimately close connection on releasing if True.)r�r`s rZr��BaseConnector.force_close�s��� � � r]c��UR$)zyThe total number for simultaneous connections.85 86If limit is 0 the connector has no limit.87The default limit size is 100.88)r�r`s rZr��BaseConnector.limit�s���{�{�r]c��UR$)z�The limit for simultaneous connections to the same endpoint.89 90Endpoints are the same if they are have equal91(host, port, is_ssl) triple.92)r�r`s rZr��BaseConnector.limit_per_host�s���#�#�#r]c��UR(a!URR5 SUl[5nURnUR(a�[[5nX-93nURR5H�upV[
5nUH�up�UR5(aX�-94S:�aURX�45 M6URn95UR5 UR(aMeUR(dMxURRU965 M� U(dM�XsU'M� X0lUR(a2[R "USUUR"UR$S9Ulgg)zCleanup unused transports.Nr�_cleanup�r�)r��cancelrr�r�rr�itemsr�r�r�r�r��is_sslrr"�weakref_handler�r�)rY�now�timeoutr�deadlinerr�alive�proto�use_timer�s           rZr$�BaseConnector._cleanup�s0������ � �'�'�)�$(�D� ��k���)�)���;�;�%�e�,�K��}�H�"�k�k�/�/�1�97��>C�g��',�O�E��)�)�+�+��0C�q�0H����e�%6�7� � %���I��K�K�M��8�8�8�S�Z�Z�Z��7�7�>�>�y�I�(-��5�',��$�2�&�K��;�;�#*�#9�#9�����98�99�'+�'C�'C�$�D� �r]c�R�UR(aURR5 URHnUcMUR5 M /UlUR(d<[100R"USURURURS9Ulgg)znDouble confirmation for transport close.101 102Some broken ssl servers may leave socket open without proper close.103Nrr%)104r�r&rr�r�r"r)�_cleanup_closed_periodr�r�)rYr�s  rZr�BaseConnector._cleanup_closed�s���105�&�&��'�'�.�.�0��8�8�I��$����!�9�+-��'��,�,�*1�*@�*@��!��+�+��106�107�'+�'C�'C�+�D�'�-r]��	abort_sslr5c��URUS9=n(d[[55$[U5n[R108S:�a [R"X0RSS9nOURRU5n[U5$)z�Close all opened transports.109 110:param abort_ssl: If True, SSL connections will be aborted immediately111                 without performing the shutdown handshake. This provides112                 faster cleanup at the cost of less graceful disconnection.113r4r=T�r��eager_start)114r	rPr7rzr�r�rs�Taskr��create_task)rYr5rp�coro�tasks     rZr��BaseConnector.close�sv�� �;�;��;�;�;��;�&�d�f�-�-��w�'�����w�&��<�<��:�:�4�H�D��:�:�)�)�$�/�D�!�$�'�'r]c��/nUR(aU$SUlURR5(a�UURR	5 UR115R	5 URR5HnUHnUR5 M M URR	5 SUl	URR	5 SUl$UR(aURR5 UR(aURR5 URR5H�nUH�upgU(a>UR(a-URRS5bUR5 OUR5 UR =n(dMoUR#U5 M� M� UR116H~nU(a>UR(a-URRS5bUR5 OUR5 UR =n(dMmUR#U5 M� URHn	U	cMU	R5 M UURR	5 UR117R	5 URR5HnUHnUR5 M M URR	5 SUl	URR	5 SUl$!URR	5 UR118R	5 URR5HnUHnUR5 M M URR	5 SUl	URR	5 SUlf=f)NT�119sslcontext)r�r�r�r��clearr�r�rr&r�rr�r��get_extra_infor�r�r�r�)120rYr5rp�
keyed_waiters�keyed_waiter�datar.�_r�r�s121          rZr	�BaseConnector._closes���+-���<�<��N����4	/��z�z�#�#�%�%��T
�K�K�����N�N� � �"�!%���!5�!5�!7�
�$1�L� �'�'�)�%2�"8�
�M�M���!�#'�D� ��+�+�1�1�3�*.�D�'�_�#�#��$�$�+�+�-��*�*��+�+�2�2�4����*�*�,�� $�H�E�!�!�O�O�!�O�O�:�:�<�H�T����
����
�!&���-�v�-����v�.�!%�-������������6�6�|�D�P��K�K�M��K�K�M�"�\�\�)�6�)��N�N�6�*�(�"�<�<�	��(��O�O�%�=��
�K�K�����N�N� � �"�!%���!5�!5�!7�
�$1�L� �'�'�)�%2�"8�
�M�M���!�#'�D� ��+�+�1�1�3�*.�D�'��
�K�K�����N�N� � �"�!%���!5�!5�!7�
�$1�L� �'�'�)�%2�"8�
�M�M���!�#'�D� ��+�+�1�1�3�*.�D�'�s&� M�/C M�BM�%%M�M�B2Pc��UR$)z+Is connector closed.122 123A readonly property.124)r�r`s rZr��BaseConnector.closedCs���|�|�r]rrMc��SnUR(a*UR[UR5-125=nS::aU$UR=n(a7URRU5=n(aU[U5-nX#:�aU$U$)z�126Return number of available connections.127 128The limit, limit_per_host and the connection key are taken into account.129 130If it returns less than 1 means that there are no connections131available.132r r)r��lenr�r�r��get)rYr�total_remain�host_remain�acquireds     rZ�_available_connections�$BaseConnector._available_connectionsKs������;�;�D�K�K�#�d�n�n�:M�,M�M�L�RS�S����.�.�.�;�.��2�2�6�6�s�;�;�x�;��s�8�}�,���)�"�"��r]�reqc	�&�URnUce0nURbURnUR[RU[R'[[RUUURURURS9nURR[RS5nUbOUR5(dXQR[R'U$XTR[R'U$)znSet Proxy-Authorization header for non-SSL proxy requests and builds the proxy request for SSL proxy requests.N)�headers�authr��ssl)�proxy�
proxy_headersrSr!�HOSTr1�METH_GET�133proxy_authr�rU�pop�
AUTHORIZATIONr(�PROXY_AUTHORIZATION)rYrQ�urlrS�	proxy_reqrTs      rZ�-_update_proxy_auth_header_and_build_proxy_req�;BaseConnector._update_proxy_auth_header_and_build_proxy_reqds����i�i������"$�����(��'�'�G� �[�[����3���	�	��!��M�M������������
134�	�� � �$�$�T�%7�%7��>�����:�:�<�<�8<���D�4�4�5���?C�!�!�$�":�":�;��r]�tracesrNr+rLc���# �URnURXB5IShv�N=nb$UR(aURU5 U$[	UR135UR5IShv�N URU5S::ajURXB5IShv�N URXB5IShv�N=nb5UR(aURU5 UsSSS5IShv�N $[[[UR55nURRU5 UR(aUR URU5 U(a!UHnUR#5IShv�N M UR%XU5IShv�NnU(a!UHnUR'5IShv�N M UR((aUR+5 [-S5eSSS5IShv�N URR3W5 URRW5 UR(a1UR Un	U	R3U5 U	RU5 [5XX�R65$GNwGN*GN�GN�GN�GN%GN136N�![.a UR1XF5 ef=fN�!,IShv�N(df   N�=f7f)z'Get from pool or create new connection.NrzConnector is closed.)�connection_key�_getrVr`r5�connect�ceil_thresholdrO�_wait_for_available_connectionrr0r�rr��addr�r��send_connection_create_start�_create_connection�send_connection_create_endr�r�r%�
BaseException�_release_acquired�remover|r�)137rYrQrbr+r�conn�placeholder�tracer.�acquired_per_hosts138          rZrf�BaseConnector.connect~s\���� � ���)�)�C�0�0�0�D�=��y�y��B�B�3�G��K������1G�1G�H�H��*�*�3�/�1�4��9�9�#�F�F�F�"&�)�)�C�"8�8�8�D�E��y�y��J�J�3�O��
I�H�H���!6�t�7O�7O�!P��K�
�N�N���{�+��#�#��'�'��,�0�0��=�
H��!'��#�@�@�B�B�B�"(�"�5�5�c�7�K�K���!'��#�>�>�@�@�@�"(��<�<��K�K�M�/�0F�G�G� �=I�H�N	
�����k�*������5�!���� $� 7� 7�� <���$�$�[�1��!�!�%�(��$�U�J�J�7�7�i1�I�F�8�I�*C�K�A�� �
��&�&�s�8��
��5I�H�H�H�s��!K-�J�AK-�3J�4K-�7*K�!J �"K�:J#�;*K�%K-�1J&�2K-�7A-K�%J1�J)�J1�"J,�##J1�J/�J1�-K�<K-�K�BK-�K-� K�#K�&K-�)J1�,J1�/J1�1K�K�K-�K*�K�K*�&K-c��# �SnURR5nURUnSXT'U(aURUSS9 U(a!UHnUR	5IShv�N M UIShv�N U(a!UHnUR5IShv�N M UR
US5 URRUS5(d
URU	URU5S:�agUS-
nM�N�N�Ni!UR
US5 URRUS5(dURU	ff=f7f)z&Wait for an available connection slot.rTNF��lastr )	r�rr��move_to_end�send_connection_queued_start�send_connection_queued_endr[rKrO)rYrrb�attempts�futrBrrs       rZrh�,BaseConnector._wait_for_available_connection�s>������(,�139�140�(@�(@�(B�C� �M�M�#�.�M�!%�M����)�)�#�E�)�:�
+��!'��#�@�@�B�B�B�"(��	�	��!'��#�>�>�@�@�@�"(�141�!�!�#�t�,��}�}�(�(��d�3�3��
�
�c�*��*�*�3�/�!�3����M�H�;�C��A���!�!�#�t�,��}�}�(�(��d�3�3��
�
�c�*�4�sV�AE�D�*D�+
D�8D�9#D�D�D�%AE�D�D�D�AE�Ec��># �URRU5=ncg[5nU(Ga9UR5upVUR	5(a�XF-142UR143::a�U(d
URU	URRU5 UR(aURURU5 U(a"UHnUR5IShv�N M [XXPR5$URnUR!5 UR"(d,UR$(aUR&R)U5 U(aGM9URU	gN�![a URX5 ef=f7f)z^Get next reusable connection for the key or None.144 145The connection will be marked as acquired.146N)r�rKr�popleftr�r�r�rir�r��send_connection_reuseconnrmrnr|r�r�r�r�r(rr�)	rYrrbr�t1r.�t0rrr�s	         rZre�BaseConnector._get�sG����[�[�_�_�S�)�)�E�2��
�[����
�
��I�E��!�!�#�#���4�3J�3J�(J�����C�(����"�"�5�)��'�'��+�+�C�0�4�4�U�;��!'��"�"'�"A�"A�"C�C�C�"(�"�$�U�J�J�?�?����I��K�K�M��0�0�S�Z�Z��/�/�6�6�y�A�3�e�8
�K�K����D��,�"� �2�2�3�>�!�"�s7�CF�E=�+E;�,E=�0A:F�-F�;E=�=F�Fc�r�UR(dg[UR5n[R"U5 UHtnUR	U5S:aMURUnU(dM2URSS9upEUR
5(dURS5  gU(aMBMv g)z�147Iterates over all waiters until one to be released is found.148 149The one to be released is not finished and150belongs to a host that has available connections.151Nr Frv)r��list�random�shufflerO�popitem�doner:)rY�queuesrrp�waiterrEs      rZ�_release_waiter�BaseConnector._release_waiter
s����}�}���d�m�m�$�����v���C��*�*�3�/�!�3���m�m�C�(�G��'�#�O�O��O�7�	���{�{�}�}��%�%�d�+��	�'�r]r.c�.�UR(agURRU5 UR(aGURRU5=n(a%URU5 U(d
URU	UR
5 g)zRelease acquired connection.N)r�r��discardr�r�rKr�)rYrr.rs    rZrn�BaseConnector._release_acquired'sk���<�<�������u�%����d�.E�.E�.I�.I�#�.N�%N�U�%N��M�M�%� ���+�+�C�0����r]r�r�r�c�2�UR(agURX5 UR(dU(dUR(aZURnUR5 UR(a,UR(dURRU5 gURURU[545 URc<[R"USURUR UR"S9Ulgg)Nr$r%)r�rnr�r�r�r�r(r�rr�r�rr�r"r)r�r�r�)rYrr�r�r�s     rZr��BaseConnector._release4s����<�<�����s�-������0E�0E� �*�*�I��N�N���z�z�$�"?�"?��/�/�6�6�y�A�����C�����9�;� 7�8����'�#*�#9�#9����'�'��152�153�'+�'C�'C�$�D� �(r]c��# �[5e7fr�)�NotImplementedError)rYrQrbr+s    rZrk� BaseConnector._create_connectionTs���"�#�#�s�
)r�r�r�r�rr�r�r�r�r�r�r�r�r�rr�r�r�)rVrH)NNNrh)6rirjrkrlr�r�r�r2�HIGH_LEVEL_SCHEMA_SET�allowed_protocol_schema_setr8r�objectr�r��intrrsr�r[rcrrfrrrrrmrrr�r�r�r�r$rrr�rr	r�rOr1r`r|rfrhrer�r0rnr�rkrnror]rZrHrH
s�����G���!��"7��1549A�!���&+�48�()�K�!���u�!4�5�K��	K�155�K��
K� $�K��w�0�0�1�K�!&�K�156�K�Z(0�3��3�D�3�*��S��T���15737�-1�15�	��4�
�.�/���M�*�� �
�.�	�158159���!�T�!��!���s�����$��$��$�%�N�.*/�(�$�(�9�T�?�(�(+0�</�4�</�D��6�9J�4K�</�|�������/��c��2� ��	��498� �98�*.�w�-�98�BQ�98�	�98�v(�"�(�,0��M�(�	
�(�T(�"�(�,0��M�(�	�*�	�(�T�4�_��_��QU��$#��
��"��160��161�
�@$� �$�*.�w�-�$�BQ�$�	�$r]rHc���\rSrSrSS\\S\SS4SjjrS\S\	4Sjr162S	\\\4S163\
\SS4SjrS	\\\4SS4SjrSS
jrS	\\\4S\
\4SjrS	\\\4S\	4SjrSrg)�_DNSCacheTableiZN�ttl�max_sizerVc�H�[5Ul0UlXlX lgr�)r�	_addrs_rr�_timestamps�_ttl�	_max_size)rYr�r�s   rZr[�_DNSCacheTable.__init__[s$��
�M�	
��:<����	�!�r]�hostc��XR;$r�)r�)rYr�s  rZ�__contains__�_DNSCacheTable.__contains__cs���~�~�%�%r]r�addrsc��XR;aURRU5 [U5[U54URU'URb[5URU'[UR5UR:�a8URRSS9up4URRUS5 gg)NFrv)164r�rxr	rJr�rr�r�r�r[)rYrr��165oldest_keyrEs     rZri�_DNSCacheTable.addfs����.�.� ��N�N�&�&�s�+�$�U�|�S��Z�8����s���9�9� �$-�K�D���S�!��t�~�~�����/� �N�N�2�2��2�>�M�J���� � ��T�2�0r]c�t�URRUS5 URRUS5 gr�)r�r[r��rYrs  rZro�_DNSCacheTable.removess,�������3��%������S�$�'r]c�l�URR5 URR5 gr�)r�r@r�r`s rZr@�_DNSCacheTable.clearws$������������� r]c��URUup#[[X#55n[U5 URR	U5 U$r�)r�r�r166�nextrx)rYrr��lengthr�s     rZ�167next_addrs�_DNSCacheTable.next_addrs{s?���~�~�c�*����V�D�)�*���T�168����"�"�3�'��r]c�l�URcgURUUR-[5:$rX)r�r�rr�s  rZ�expired�_DNSCacheTable.expired�s0���9�9�������$�t�y�y�0�9�;�>�>r])r�r�r�r�)N��rh)rirjrkrlrr�r�r[r�r�r�rr�rr$riror@r�r�rnror]rZr�r�Zs���"�H�U�O�"�c�"�T�"�&��&�D�&�3�u�S�#�X��3�t�M�/B�3�t�3�(�%��S��/�(�d�(�!��e�C��H�o��$�}�2E��?�5��c��?�?�t�?r]r��verifiedc���[cgU(a[R"5nO�[R"[R5nU=R[R169-slU=R[R-slSUl[RUl	U=R[R-slUR5 URS5 U$)z�Create SSL context.170 171This method is not async-friendly and should be called from a thread172because it will load certificates from disk and do other blocking I/O.173NF)zhttp/1.1)
rU�create_default_context�174SSLContext�PROTOCOL_TLS_CLIENT�options�OP_NO_SSLv2�OP_NO_SSLv3�check_hostname�	CERT_NONE�verify_mode�OP_NO_COMPRESSION�set_default_verify_paths�set_alpn_protocols)r�r?s  rZ�_make_ssl_contextr��s����{����/�/�1�175��^�^�C�$;�$;�<�176����c�o�o�-�����c�o�o�-��$)�177�!�!$���178�����c�3�3�3���+�+�-��!�!�-�0��r]TFc.��^�\rSrSrSr\\"S15-rSSSSS\RRSSSS\SS	S179SSSSSS\S
.S\S\
\S\S\
\S\S\RS\
\S\\\\4S\
\\\4S\
\S\S\\4S\S\S\S\S\
\R2S\S\
\S \
\S!\
\S"\\S\44*U4S#jjjrSS$.S%\S&\\\4U4S'jjjrSS$.S%\S&S4U4S(jjjr \!S&\4S)j5r"\!S&\4S*j5r#SNS+\
\S,\
\S&S4S-jjr$SOS+\S,\S.\
\%S/S&\\&4S0jjr'S1\\\4S+\S,\S2\(S3S.\
\%S/S&\\&4S4jr)S5\*S.\S/S6S7S&\+4S8jr,S5\*S&\
\4S9jr-S5\*S&\
S:4S;jr.\/S<.S=\0S>\\1S5\*S6S7S?\2\3S@\0S&\\Rh\+44SAjjr5\/S<.S=\0S5\*S6S7S?\2\3S@\0S&\\Rh\+44SBjjr6SPSCjr7SQSDjr8S&\4SEjr9SF\RhS5\*S&S4SGjr:\/4SF\RhS5\*S6S7S?\2\3S&\\Rv\+44180SHjjr<SI\\&S&\\14SJjr=\/S<.S5\*S.\S/S6S7S?\2\3S&\\Rh\+44181SKjjr>S5\*S.\S/S6S7S&\\Rv\+44SLjr?SMr@U=rA$)RrIi�u^TCP connector.182 183verify_ssl - Set to True to check ssl certifications.184fingerprint - Pass the binary sha256185    digest of the expected certificate in DER format to verify186    that the certificate the server presents matches. See also187    https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning188resolver - Enable DNS lookups and use this189    resolver190use_dns_cache - Use memory cache for DNS lookups.191ttl_dns_cache - Max seconds having cached a DNS entry, None forever.192family - socket address family193local_addr - local tuple of (host, port) to bind socket to194 195keepalive_timeout - (optional) Keep-alive timeout.196force_close - Set to True to force close and do reconnect197    after each request (and between redirects).198limit - The total number of simultaneous connections.199limit_per_host - Number of simultaneous connections to one host.200enable_cleanup_closed - Enables clean-up closed ssl transports.201                        Disabled by default.202happy_eyeballs_delay - This is the “Connection Attempt Delay”203                       as defined in RFC 8305. To disable204                       the happy eyeballs algorithm, set to None.205interleave - “First Address Family Count” as defined in RFC 8305206loop - Optional event loop.207socket_factory - A SocketFactoryType function that, if supplied,208                 will be used to create sockets given an209                 AddrInfoType.210ssl_shutdown_timeout - DEPRECATED. Will be removed in aiohttp 4.0.211                       Grace period for SSL shutdown handshake on TLS212                       connections. Default is 0 seconds (immediate abort).213                       This parameter allowed for a clean SSL shutdown by214                       notifying the remote peer of connection closure,215                       while avoiding excessive delays during connector cleanup.216                       Note: Only takes effect on Python 3.11+.217�tcpTN�218r�Fr�rr�g�?)�219verify_ssl�fingerprint�
use_dns_cache�
ttl_dns_cache�dns_cache_max_size�family�ssl_contextrU�220local_addr�resolverr�r�r�r�r�r�r��happy_eyeballs_delay�221interleave�socket_factory�ssl_shutdown_timeoutr�r�r�r�r�r�r�rUr�r�r�r�r�r�r�r�r�r�r�r�r�c222�P>�[TU]UUU
UUUUS9 [X�Xr5UlU U223c [	UR224S9UlSUlO
X�lSUlX0l[XES9Ul2250UlX`l[R"U	5UlUUlUUl[%5UlUUlU U[*LaSUlg[.R0"S[2SS	9 [4R6S226:a'Ub$US:wa[.R0"SUS3[8SS	9 UUlg)
Nr�r�TF)r�r�rzSThe ssl_shutdown_timeout parameter is deprecated and will be removed in aiohttp 4.0r�r��r>�zssl_shutdown_timeout=zd is ignored on Python < 3.11; only ssl_shutdown_timeout=0 is supported. The timeout will be ignored.)�superr[r3�_sslr<r��	_resolver�_resolver_owner�_use_dns_cacher��
_cached_hosts�_throttle_dns_futures�_family�aiohappyeyeballs�addr_to_addr_infos�_local_addr_infos�_happy_eyeballs_delay�_interleaver��_resolve_host_tasks�_socket_factoryr8�_ssl_shutdown_timeoutrcrdrer�r��RuntimeWarning)rYr�r�r�r�r�r�r�rUr�r�r�r�r�r�r�r�r�r�r�r�r��	__class__s                      �rZr[�TCPConnector.__init__�sC���2	���/�#��)�"7��#9�	�	227�&�c�{�P��	����,�$�*�*�=�D�N�#'�D� �%�N�#(�D� �+��+��228���229
�	
�"���!1�!D�!D�Z�!P���%9��"�%���MP�U�� �-�����8�+�)*�D�&�
�M�M�e�"��
�� � �7�*�(�4�(�A�-��
�
�+�,@�+A�B]�]�"� �	�*>�D�&r]r4r5rVc�>�[R"URR55HnUR	5 M [230TU]US9nURH$nUR	5 URU5 M& U$)zClose all ongoing DNS calls.r4)	r�
from_iterabler�rr&r�r	r�r�)rYr5r|rp�tr�s     �rZr	�TCPConnector._close$so����&�&�t�'A�'A�'H�'H�'J�K�C��J�J�L�L��'�.�9�.�5���)�)�A�
�H�H�J��N�N�1��*��r]c���># �UR(a"URR5IShv�N [TU]	U=(d URS:HS9IShv�N gN0N7f)a�231Close all opened transports.232 233:param abort_ssl: If True, SSL connections will be aborted immediately234                 without performing the shutdown handshake. If False (default),235                 the behavior is determined by ssl_shutdown_timeout:236                 - If ssl_shutdown_timeout=0: connections are aborted237                 - If ssl_shutdown_timeout>0: graceful shutdown is performed238Nrr4)r�r�r�r�r�)rYr5r�s  �rZr��TCPConnector.close1sT��������.�.�&�&�(�(�(��g�m�i�&R�4�3M�3M�QR�3R�m�S�S�S�
)�S�s!�/A'�A#�*A'�A%�A'�%A'c��UR$)zSocket family like AF_INET.)r�r`s rZr��TCPConnector.family@s���|�|�r]c��UR$)z%True if local DNS caching is enabled.)r�r`s rZr��TCPConnector.use_dns_cacheEs���"�"�"r]r��portc��Ub UbURRX45 gUcUb[S5eURR5 g)z8Remove specified host/port or clear all dns local cache.Nz5either both host and port or none of them are allowed)r�ror�r@)rYr�r�s   rZ�clear_dns_cache�TCPConnector.clear_dns_cacheJsN����� 0����%�%�t�l�3�
�
��!1��T�U�U����$�$�&r]rbrNc��H# �[U5(aUUUURSSS./$UR(d�U(a"UHnURU5IShv�N M URRXURS9IShv�NnU(a"UHnUR
U5IShv�N M U$X4nX`R;afURRU5(dFURRU5nU(a"UHnURU5IShv�N M U$X`R;a�URUnURR5n	URU	5 U(a"UHnURU5IShv�N M U	IShv�N URU	5 URRU5$[!5=URU'nUR#XaX(U5n239[$R&"5n[(R*S:�a[$R,"X�SS9nOUR/U2405nUR15(d@UR2RU5 UR5UR2R5 [$R6"U5IShv�N$GNqGNDGN"GN�GN<GN0!URU	5 f=fN,![$R8a S	Sjn
UR5U
5 ef=f7f)241z*Resolve host and return list of addresses.r)�hostnamer�r�r�r.�flagsN�r�r=Tr7c��[[[R5 UR	5 SSS5 g!,(df   g=fr�)rrvrs�CancelledError�result)r|s rZ�drop_exception�2TCPConnector._resolve_host.<locals>.drop_exception�s(���i��)?�)?�@��J�J�L�A�@�@�s	�9�242A)r|z#asyncio.Future[List[ResolveResult]]rVN)r6r�r��send_dns_resolvehost_startr��resolve�send_dns_resolvehost_endr�r�r��send_dns_cache_hitr�r�rrir�r��_resolve_host_with_throttlersr�r�r�r9r:r�r��add_done_callback�shieldr)rYr�r�rbrrryrr�futures�futurer;r��resolved_host_taskrs              rZ�
_resolve_host�TCPConnector._resolve_hostUs��������!%� � �"�l�l���
�	�	
��"�"��#�E��:�:�4�@�@�@�$����.�.�t�$�,�,�.�O�O�C��#�E��8�8��>�>�>�$��J��l���$�$�$�T�-?�-?�-G�-G��-L�-L��'�'�2�2�3�7�F��#�E��2�2�4�8�8�8�$��M��,�,�,��0�0��5�G�+/�:�:�+C�+C�+E�F��K�K����#�E��2�2�4�8�8�8�$�
(��������'��%�%�0�0��5�5�58�E�9��"�"�3�'�'��/�/��4�&�Q���'�'�)�����w�&�!(���d�4�!P��!%�!1�!1�$�!7��!�&�&�(�(��$�$�(�(�);�<��0�0��1I�1I�1Q�1Q�R�		� ���(:�;�;�;�{A�O�?�9�"9�������'��.<���%�%�	�
!�
�0�0��@��	�s��AL"�K	�/L"�K�	$L"�-K�.A7L"�%K�&A3L"�K�L"�#K�(K�)K�-C=L"�+K3�K1�K3�L"�L"�L"�L"�L"�K�K.�.L"�1K3�3,L�L"rr
zasyncio.Future[None]c��# �U(aDUHnURU5IShv�N M UHnURU5IShv�N M URRX#URS9IShv�NnU(a"UHnURU5IShv�N M URRX5 UHn[US5 M URRU5 URRU5$N�N�N�Nu![an	UHn[X�5 M eSn	A	ff=f!URRU5 f=f7f)z�Resolve host and set result for all waiters.243 244This method must be run in a task and shielded from cancellation245to avoid cancelling the underlying lookup.246Nr)�send_dns_cache_missrr�rr�rr�rir:rmr9r�r[r�)247rYrr�r�r
rbrrr�r|�es248          rZr249�(TCPConnector._resolve_host_with_throttle�s7���	0��#�E��3�3�D�9�9�9�$�$�E��:�:�4�@�@�@�$��.�.�0�0��D�L�L�0�Q�Q�E��#�E��8�8��>�>�>�$�
���"�"�3�.����3��%��
�&�&�*�*�3�/��!�!�,�,�S�1�1�/:�A�Q�?��250�	����c�%����
	��
�&�&�*�*�3�/�sz�E� D�D�!D�D
�/D�6D�7$D�D�8D�6E�D�
D�D�D�251D7�D2�2D7�7D:�:E�ErQr+rLc��# �UR(aURXU5IShv�NupEU$URXU5IShv�NupEU$N&N2527f)zSCreate connection.253 254Has same keyword arguments as BaseEventLoop.create_connection.255N)rV�_create_proxy_connection�_create_direct_connection)rYrQrbr+rEr.s      rZrk�TCPConnector._create_connection�sS����9�9�!�:�:�3��P�P�H�A���"�;�;�C��Q�Q�H�A���	Q�Q�s!�'A�A�A�A�	A�Ac�>�UR5(dg[c[S5eURn[U[R5(aU$USLa[256$URn[U[R5(aU$USLa[257$[$)a�Logic to get the correct SSL context258 2590. if req.ssl is false, return None260 2611. if ssl_context is specified in req, use it2622. if _ssl_context is specified in self, use it2633. otherwise:264    1. if verify_ssl is not specified in req, use self.ssl_context265       (will generate a default context according to self.verify_ssl)266    2. if verify_ssl is True in req, generate a default SSL context267    3. if verify_ssl is False in req, generate a SSL context that268       won't verify269NzSSL is not supported.T)r(rU�RuntimeErrorrur��_SSL_CONTEXT_UNVERIFIEDr��_SSL_CONTEXT_VERIFIED)rYrQr?s   rZ�_get_ssl_context�TCPConnector._get_ssl_context�s����z�z�|�|���;��6�7�7��W�W�270��j�#�.�.�1�1����T�!�*�*��Y�Y�271��j�#�.�.�1�1����T�!�*�*�$�$r]r2c��URn[U[5(aU$URn[U[5(aU$gr�)rUrur2r�)rYrQ�rets   rZ�_get_fingerprint�TCPConnector._get_fingerprints;���g�g���c�;�'�'��J��i�i���c�;�'�'��J�r]��client_error�args�272addr_infosr%r�c273��# �[URURS9IShv�N [R"UUR274URURURURS9IShv�NnURS5(a4UR(a#[RS:�aURUS'URR"U0UDSU0D6IShv�NsSSS5IShv�N $N�N�NN!,IShv�N(df   g=f![an[!UR"U5UeSnAf[$an['UR"U5UeSnAf[(aFnUR*c [-U[.R05(aeU"UR"U5UeSnAff=f7f)N�rg)r'�local_addr_infosr�r�r�r�rUr�r��sock)r5�sock_connectrgr��start_connectionr�r�r�r�r�rKr�r�r��create_connectionr.r&rdr/r)�OSError�errnorurs�TimeoutError)	rYr'rQr+r%r&r�r+rs	         rZ�_wrap_create_connection�$TCPConnector._wrap_create_connections{���	A�#��$�$�W�5K�5K���.�>�>�)�%)�%;�%;�)-�)C�)C�#�/�/����#'�#7�#7�
����J�J�u�%�%��2�2��(�(�G�3�59�5O�5O�F�1�2�!�Z�Z�9�9�4�U�6�U�PT�U�U�%����V�%�����&�	T�1�#�2D�2D�c�J�PS�S���	L�)�#�*<�*<�c�B��K���	A��y�y� �Z��W�5I�5I�%J�%J���s�1�1�3�7�S�@��	A�s��F>�"D#�D�D#�AD	�9D�:A1D	�+D�,D	�/D#�;D�<D#�F>�D#�D	�D	�D#�	D �D�D �D#�F>� D#�#275F;�-E�
F;�E(�(
F;�5AF6�6F;�;F>c��:# �[URURS9IShv�N URR"U0UD6IShv�NsSSS5IShv�N $N9NN	!,IShv�N(df   g=f![276an[
URU5UeSnAf[an[URU5UeSnAf[aFnURc [U[R5(aeU"URU5UeSnAff=f7f�Nr))r5r,rgr�r.r.r&rdr/r)r/r0rursr1)rYrQr+r%r&r�rs       rZ�_wrap_existing_connection�&TCPConnector._wrap_existing_connection7s����	A�#��$�$�W�5K�5K���"�Z�Z�9�9�4�J�6�J�J����K�������	T�1�#�2D�2D�c�J�PS�S���	L�)�#�*<�*<�c�B��K���	A��y�y� �Z��W�5I�5I�%J�%J���s�1�1�3�7�S�@��	A�s��D�"B�A �B� A&�277A"�A&�B�A$�B�D� B�"A&�$B�&A=�,A/�-A=�9B�<D�=B�278D�279B!�!
D�.C�
D�AD�D�Dc��UR5(dgURnUceURS:wagUR5 g)z�Raise a :py:exc:`RuntimeError` on missing ``start_tls()``.280 281It is necessary for TLS-in-TLS so that it is possible to282send HTTPS queries through HTTPS proxies.283 284This doesn't affect regular HTTP requests, though.285NrC)r(rV�scheme�_check_loop_for_start_tls)rYrQ�	proxy_urls   rZ�_fail_on_no_start_tls�"TCPConnector._fail_on_no_start_tlsMsD���z�z�|�|���I�I�	��$�$�$����w�&���&�&�(r]c�n�URR g![an[S5UeSnAff=f)Na�An 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.286 287Please upgrade to Python 3.11 or higher. For more details, please see:288* https://bugs.python.org/issue37179289* https://github.com/python/cpython/pull/28073290* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support291* https://github.com/aio-libs/aiohttp/discussions/6044292)r��	start_tls�AttributeErrorr)rY�attr_excs  rZr:�&TCPConnector._check_loop_for_start_tls_s<��	��J�J� � ���	��	K���
��	�s��2934�/�4c�F�UR5 g![a gf=f)NTF)r:rr`s rZ�_loop_supports_start_tls�%TCPConnector._loop_supports_start_tlsps,��	��*�*�,����	��	�s��294 � �underlying_transportc�6�URRRS:wag[U5RRS5(ag[RS:�=(d
 [USS5nU(ag[R"S[USS	9 g)295z6Issue a warning if the requested URL has HTTPS scheme.rCN�uvloopr��_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 (Python <3.11). This is why you'll probably see an error in the log below.296 297It is possible to enable it via monkeypatching. For more details, see:298* https://bugs.python.org/issue37179299* https://github.com/python/cpython/pull/28073300 301You can temporarily patch this as follows:302* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support303* https://github.com/aio-libs/aiohttp/discussions/6044304r>)r�r�)�request_infor^r9�typerj�305startswithr�r��getattrrcrdr�)rYrFrQ�asyncio_supports_tls_in_tlss    rZ�_warn_about_tls_in_tls�#TCPConnector._warn_about_tls_in_tlsxs��������&�&�'�1���$�%�0�0�;�;�H�E�E��'*�&6�&6�'�&A�'306�W� �#��F307�#�'���
�
�308
G�
���!	309r]c���# �UR5nURU5n[(aUce[URUR310S9IShv�N [RS:�arUR(aaURRUUUUR=(d URUR=(d SURS9IShv�NnOVURRUUUUR=(d URUR=(d SS9IShv�Nn[#U[$R&5(a*UR)U5nU(aUR+U5 SSS5IShv�N WcSn	U"UR4[7U	55eUR9U5 Xu4$GNpN�N�![a3 URS:XaUR5 eUR!5 ef=f![,a> UR!5 UR.(dUR0R3U5 ef=fN�!,IShv�N(df   N�=f![:an311[=UR4U3125U313eSn314A315f[>an316[AUR4U3175U318eSn319A320f[6aFn321U322RBc [#U323[$RD5(aeU"UR4U3245U325eSn326A327f[FaVn[ISUR<S	URJS328SURL<SURN=(d S
SU<S35UeSnAff=f7f)z$Wrap the raw TCP transport with TLS.Nr)r�)�server_hostname�ssl_handshake_timeoutr�)rRrSrz:Failed to start TLS (possibly caused by closing transport)z2Cannot initialize a TLS-in-TLS connection to host �:�dz4 through an underlying connection to an HTTPS proxy z ssl:�defaultz [�])(r�rr
r5r,rgr�r�r�r�r?rRr��totalrmr�r�rursr�r"�checkr,r�rr�rdr/�connection_mader.r&r/r)r0r1�	TypeErrorr%r�rVrU)rYrFrQr+r%�	tls_protor?�
tls_transportr��msgr�type_errs            rZ�_start_tls_connection�"TCPConnector._start_tls_connection�s!����M�M�O�	��*�*�3�/�329��=��)�)�)�C	�#��$�$�W�5K�5K�����'�'�7�2�t�7Q�7Q�.2�j�j�.B�.B�0�%�&�,/�,?�,?�,K�3�8�8�29�-�-�2G�4�15�1K�1K�
/C�/�)�
�/3�j�j�.B�.B�0�%�&�,/�,?�,?�,K�3�8�8�29�-�-�2G�4�/C�/�)�
� �m�W�->�->�?�?�"&�"7�"7��"<�K�"�"�'�-�-�m�<�G��z�$�R��"�3�#5�#5�w�s�|�D�D��%�%��
��'�'�I�)�)��%���1�1�Q�6�,�2�2�4��-�2�2�4���� 9�"�)�/�/�1�#'�#@�#@� $� ?� ?� F� F�}� U�!�	"��I�����R�	T�1�#�2D�2D�c�J�PS�S���	L�)�#�*<�*<�c�B��K���	A��y�y� �Z��W�5I�5I�%J�%J���s�1�1�3�7�S�@���330	�331(�D��8�8�,�a�����|�,%�%(�Y�Y�M��s�w�w�7K�)�6L�M��<�q�"��332�
��333	�s��2M.�"I5�G�I5�I�BG�G334�G�"I�#AG�3G�4G�88I�1H�I5�
I�I5�5M.�I5�335G�G�=H�I�AI�I�I5�I2�!I$�"I2�.I5�5336M+�?J�
M+�#J:�:
M+�AL�
M+�AM&�&M+�+M.�hostsc�R�/nUH�nUSnSU;nU(a[RO[RnUR(aURU:waMWU(aXCSSS4OXCS4nUR	U[R337[RSU45 M� U$)z�Converts the list of hosts to a list of addr_infos.338 339The list of hosts is the result of a DNS lookup. The list of340addr_infos is the result of a call to `socket.getaddrinfo()`.341r�rTr�rrA)�socket�AF_INET6�AF_INETr�r��SOCK_STREAM�IPPROTO_TCP)rYrbr'�hinfor��is_ipv6r��addrs        rZ�_convert_hosts_to_addr_infos�)TCPConnector._convert_hosts_to_addr_infos�s���*,�342��E���=�D��T�k�G�(/�V�_�_�V�^�^�F��|�|����� 6��29�D��-��A�.��F�m�?T�D������+�+�V�-?�-?��T�J�
���r]c343���# �URU5nURU5nURRnUceUR	S5(aURS5S-nURnUceURXxUS9IShv�Nn	SnURU	5nU(a�U(a$UR =(d URS5OSn
UR#UR$UUUU
UUS9IShv�Nup�UR/5(aU(aUR1U5 X�4$X�4$UceUeN�![aIn344U345Rc [U346[R5(ae[URU3475U348eSn349A350ff=fN�![&[R4a.n351U352n[(R*"X�R,5 Sn353A354GM6Sn355A356ff=f![2a�n357UR55 UR6(dUR8R;U5 U358nUR=S5nUR?5n[(R@"UU5 Sn359A360GM�Sn361A362ff=f7f)Nz..�.)rb)r+rUr'rRrQr%rd)!rr"r^�raw_host�endswith�rstripr�rr/r0rursr1r'rdrlrRr2r�r(r��pop_addr_infos_interleaver�r(rYr,r�r�rr�rA�getpeername�remove_addr_infos)rYrQrbr+r%r?r�r�r�rbr�last_excr'rR�transpr.r+�bad_peers                  rZr�&TCPConnector._create_direct_connectionsR����*�*�3�/�363��+�+�C�0���w�w���������=�=�����;�;�s�#�c�)�D��x�x������364	L��,�,�T��,�G�G�E�)-���6�6�u�=�365��>H��$�$�,��4�4�S�9�T�
�

�&*�&B�&B��M�M�#�"�)�$3��!-�'C�'�!�
���z�z�|�|����%�%�f�-��=� �6�=� ��'�'�'��N�cH���	L��y�y� �Z��W�5I�5I�%J�%J��*�#�*<�*<�c�B��K��	L��"!��)�'�*>�*>�?�
��� �:�:�:�GW�GW�X���
��1�	��L�L�N��8�8��7�7�>�>�v�F�"�H�*0�*?�*?��*I�D�#�/�/�1�H�$�6�6�z�8�L���	�s��A9I4�<E�E�E�AI4�"F�>F�?F�I4�"G%�3
I4�E�366F�AF�F�I4�F�G"�4"G�I4�G"�"I4�%367I1�/A6I,�%I4�,I1�1I4c	��$# �URU5 UR5nURU5nURU/U[S9IShv�NupgUR5(GaU(aUR
Xa5 [RUl	URUl368URRSSSS9n[XXpR5n	URU	5IShv�Nn369U	R nUceUR#UUR$S9 U370R'U	5IShv�NnSU	lUR(S:wacUR*n
U
c[-UR(5R.n
[1U371R2UR4UR(U
UR6S9eU(d.UR9SSS9nUc[;S5eUR=5nU(dURA5 U(dQURCU5nUREURFUUWURHUS	9IShv�NU372RA5 $URKUUUS3739IShv�NU374RA5 $Xg4$GN5GN�GNV![>a URA5 ef=f!U(dURA5 ff=fN�N^![>a" U375RA5 U	RA5 ef=f!U376RA5 f=f7f)Nr$)rVrZ�proxy_headers_hash)�read_until_eofr���)�statusr�rSrd)rVz)Transport does not expose socket instance)r+rUr+rRrQ)rQr+)&r<rDr`rr+r(rOr!�METH_CONNECT�methodr^rd�_replacer�r��sendr��set_response_paramsr��startr~�reasonr�phraser*rJ�historyrSrAr�duprmr�rr6r�r�r`)rYrQrbr+�runtime_has_start_tlsr_r�r.rrp�377proxy_respr��respr��rawsockr?s                rZr�%TCPConnector._create_proxy_connectionYs����	
�"�"�3�'� $� =� =� ?���F�F�s�K�	�"&�!?�!?��r�7�1K�"@�"378�379��	��:�:�<�<�$��+�+�I�;� $�0�0�I���G�G�I�M��$�$�-�-��t��.��C�,�D�u�j�j�I�D�(�~�~�d�3�3�J�D
#��>�>���+�+�+�380�,�,�#8�+/�+G�+G�-��(�-�-�d�3�3��"&���*��{�{�c�)�"&�+�+��"�?�&0����&=�&D�&D�G�2�&�3�3� �L�L�#'�;�;�$+�$(�L�L���1�"+�":�":�8�T�":�"R��"�?�".� K�#��#*�+�+�-��1�!���)�,�!%�!6�!6�s�!;�J�!%�!?�!?��
�
� '�&�$�(+����
"@�"��"� � �"�"�7�7���#�8���� � �"����}381�.4�4��6%���O�O�%����1�!���)�1�����a!�
�� � �"��382�383���
��p� � �"�s��AL�J�BL�.J�/L�4?K�3J	�4K�8K;�B(J�(AK;�K�K;�L�K;�+K384�,K;�/L�L�	K�J(�(J+�+K�K;�385K;�,K8�8K;�;L
�
L)
r�r�r�r�r�r�r�r�r�r�r�r�r�)NNr�)rQr1rVNrh)Brirjrkrlr�r��	frozensetr�rd�
AddressFamily�	AF_UNSPECr8r�r�bytesr�r�rr2rr�r#r�r�rsr�rr4r[rrr	r�r�r�r�r�rr$rrr386r1r0rkrr"r(rrrrvr�r2r6r<r:rDrO�
BaseTransportr`rlrrrn�
__classcell__�r�s@rZrIrI�s����$�L#8�)�U�G�:L�"L��387 �'+�"�')�"&�'-�';�';�'E�'E�,0�48�04�/3�8@�!���&+�48�()�04�$(�6:�>F�/P>��P>��e�_�	P>�388�P>� ��}�
P>� �P>��$�$�P>��j�)�P>��4��j�0�
1�P>��U�3��8�_�-�P>��+�,�P>�!��u�f�!4�5�P>��P>��P>� �!P>�" $�#P>�$�w�0�0�1�%P>�&!&�'P>�('�u�o�)P>�*�S�M�+P>�,!�!2�3�-P>�.$�I�t�U�$:�;�/P>�P>�d+0��4��D��6�9J�4K���05�
T��
T��
T�
T��������#�t�#��#�389AE�	'��S�M�	'�08��
�	'�	
�	'�KO�Y��Y�"�Y�,4�X�g�5F�,G�Y�	
�m�	�Y�v'2�
�3��8�_�'2��'2��	'2�390�+�,�'2���'�*�+�
'2�391�m�	�'2�R� ��*.�w�-��BQ��	��%�M�%�h�z�6J�%�B�M��h�}�6M��)=�
$A��$A���&�$A��	$A�392!�$A��9�o�
$A��$A�393�w� � �/�1�	2�$A�V)=�A��A��A�!�	A�394�9�o�A��
A�395�w� � �/�1�	2�A�,)�$�"�$��)396�%�/�/�)397��)398�399�	)400�`)=�T(�%�/�/�T(��T(�!�	T(�401�9�o�T(�402�w�$�$�o�5�	6�
T(�l��-�(��	
�l�	��6)=�
I�
�I��W�
�I�!�	I��9�o�
I�403�w� � �/�1�	2�I�Vf � �f �*.�w�-�f �BQ�f �	�w�$�$�o�5�	6�f �f r]rIc��^�\rSrSrSr\\"S15-rS\SSS4S\	S	\404S405\\\
S4S\S\S
\\R"SS4U4Sjjjr\S\	4Sj5rS\S\SSSS\4SjrSrU=r$)rJi�aaUnix socket connector.406 407path - Unix socket path.408keepalive_timeout - (optional) Keep-alive timeout.409force_close - Set to True to force close and do reconnect410    after each request (and between redirects).411limit - The total number of simultaneous connections.412limit_per_host - Number of simultaneous connections to one host.413loop - Optional event loop.414�unixFr�rN�pathr�r�r�r�r�rVc�4>�[TU]UUUUUS9 Xlg)N�r�r�r�r�r�)r�r[�_path�rYr�r�r�r�r�r�r�s       �rZr[�UnixConnector.__init__�s-���	���#�/��)��	�	415��416r]c��UR$)zPath to unix socket.�r�r`s rZr��UnixConnector.path�����z�z�r]rQrbrNr+rLc���# �[URURS9IShv�N URR	UR417UR5IShv�NupESSS5IShv�N U$NPNN418!,IShv�N(df   W$=f![aTnURc [U[R5(ae[URURU5UeSnAff=f7fr5)r5r,rgr��create_unix_connectionr�r�r/r0rursr1r-r�rd�rYrQrbr+rEr.rs       rZrk� UnixConnector._create_connection�s����419	X�#��$�$�W�5K�5K���"&���!B�!B��M�M�4�:�:�"�����������������	X��y�y� �Z��W�5I�5I�%J�%J��*�4�9�9�c�6H�6H�#�N�TW�W��	X�s��C9�"B�A7�B�4A=�A9�A=�%B�0A;�1B�5C9�7B�9A=�;B�=B�B�B�B�C9�B�420C6�"AC1�1C6�6C9r��rirjrkrlr�r�r�r�r8r�r�rr�r�r�rrsr�r[r�r�r1rr0rkrnr�r�s@rZrJrJ�s����	�#8�)�V�H�:M�"M��421"�8@���48������!����!4�5�	�422���
��w�0�0�1��423���$��c����� ��*.�w�-��BQ��	��r]rJc��^�\rSrSrSr\\"S15-rS\SSS4S\	S	\424S425\\\
S4S\S\S
\\R"SS4U4Sjjjr\S\	4Sj5rS\S\SSSS\4SjrSrU=r$)rKi�a�Named pipe connector.426 427Only supported by the proactor event loop.428See also: https://docs.python.org/3/library/asyncio-eventloop.html429 430path - Windows named pipe path.431keepalive_timeout - (optional) Keep-alive timeout.432force_close - Set to True to force close and do reconnect433    after each request (and between redirects).434limit - The total number of simultaneous connections.435limit_per_host - Number of simultaneous connections to one host.436loop - Optional event loop.437�npipeFr�rNr�r�r�r�r�r�rVc�>�[TU]UUUUUS9 [UR[R4385(d[
S5eXlg)Nr�z9Named Pipes only available in proactor loop under windows)r�r[rur�rs�ProactorEventLooprr�r�s       �rZr[�NamedPipeConnector.__init__439s^���	���#�/��)��	�	440���J�J��%�%�441�442��K��
��443r]c��UR$)zPath to the named pipe.r�r`s rZr��NamedPipeConnector.path#r�r]rQrbrNr+rLc��:# �[URURS9IShv�N URR	UR444UR5IShv�NupE[R"S5IShv�N SSS5IShv�N [[ W5$N|NFN(N!,IShv�N(df   N/=f![aInURc [U[R5(ae[URU5UeSnAff=f7f)Nr)r)r5r,rgr��create_pipe_connectionr�r�rs�sleepr/r0rur1r(rdrr0r�s       rZrk�%NamedPipeConnector._create_connection(s����	I�#��$�$�W�5K�5K���"&���!B�!B��M�M�4�:�:�"�����m�m�A�&�&�&���$�O�U�+�+�%��'�������	I��y�y� �Z��W�5I�5I�%J�%J��&�s�'9�'9�3�?�S�H��	I�s��D�"C�B#�C�4B+�B%�B+�>B'�?B+�C�B)�C�D�#C�%B+�'B+�)C�+C�1B4�2C�>C�D�C�445D�AD�D�Dr�r�r�s@rZrKrK�s�����#8�)�W�I�:N�"N��446"�8@���48������!����!4�5�	�447���
��w�0�0�1��448���2��c����,� �,�*.�w�-�,�BQ�,�	�,�,r]rK)srsr�r�rdr�r�rc�collectionsrrr�449contextlibrrBr�	itertoolsrr	r450�timer�typesr�typingr
rrrrrrrrrrrrrrrrr�rrrAr!r"�abcr#r$�client_exceptionsr%r&r'r(r)r*r+r,r-r.r/�client_protor0�
client_reqrepr1r2r3r4r5r6r7r8r9r:�logr;r�r<r��collections.abcr@r��	bytearrayrUr��ImportErrorr�r��EMPTY_SCHEMA_SET�HTTP_SCHEMA_SET�
WS_SCHEMA_SET�HTTP_AND_EMPTY_SCHEMA_SETr�r��__all__�clientrLrM�tracingrNrPrzr|r�r�rHr�r�r�rrrIrJrKror]rZ�<module>r�s=����
�
�451���7�7���*�*��������(�<��0�����*�H�H�����%����w��&�
�5�)�%6�8K�K�
L�F������J����^�^�452�453�b�T�?���V�W�-�.���4��-�(�
�+�.>�>��1�M�A��!�S�%5�%5���9��#�	���454�"�	����%�,����(J�4�	�&�(9�#:�J�t�J�UK�UK�p�z��(4�4�"J	$�J	$�Z-?�-?�`�����6*�$�/��+�E�2��V �=�V �r4�M�4�nE,��E,��S5�����455��s�H�456H(�'H(
codekingpro/portable-devtools · Team Ai