%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/dns/quic/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/dns/quic/__pycache__/_asyncio.cpython-312.pyc

�

5��e����ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z
ddlZ
ddlZ
ddl
mZmZmZmZmZGd�de�ZGd�de�ZGd�de�Zy)	�N)�QUIC_MAX_DATAGRAM�AsyncQuicConnection�AsyncQuicManager�BaseQuicStream�
UnexpectedEOFc�R��eZdZ�fd�Zd�Zd�Zd
d�Zdd�Zd�Zd�Z	d�Z
d	�Z�xZS)�AsyncioQuicStreamc�X��t�|�||�tj�|_y�N)�super�__init__�asyncio�	Condition�_wake_up)�self�
connection�	stream_id�	__class__s   ��3/usr/lib/python3/dist-packages/dns/quic/_asyncio.pyr
zAsyncioQuicStream.__init__s"���
����Y�/��)�)�+��
�c���K�|j4�d{���|jj��d{���ddd��d{���y7�77�7�	#1�d{���7swYyxYw�wr)r�wait�rs r�_wait_for_wake_upz#AsyncioQuicStream._wait_for_wake_upsV�����=�=�	'�	'��-�-�$�$�&�&�&�	'�	'�	'��&��	'��	'�	'�	'��S�A&�A�A&�A�A
�A�A&�A�A&�
A�A&�A#�A�A#�A&c��0K�	|j|�}|jj|�ry||_	t	j
|j
�|��d{���d|_�i7�#t$rtjj�wxYw�w)Nr)�_timeout_from_expiration�_buffer�have�
_expectingr�wait_forr�TimeoutError�dns�	exception�Timeout)r�amount�
expiration�timeouts    rr!zAsyncioQuicStream.wait_for"s�������3�3�J�?�G��|�|� � ��(��$�D�O�
,��&�&�t�'=�'=�'?��I�I�I� �D�O��J���
,��m�m�+�+�+�
,�s.�6B�'A/� A-�!A/�%B�-A/�/$B�Bc��4K�|j|�}|jd|��d{���tjd|jjd��\}|j||��d{���|jj|�S7�j7�!�w)N�z!H)�_expiration_from_timeoutr!�struct�unpackr�get)rr(r'�sizes    r�receivezAsyncioQuicStream.receive.s}�����2�2�7�;�
��m�m�A�z�*�*�*��-�-��d�l�l�&6�&6�q�&9�:����m�m�D�*�-�-�-��|�|����%�%�	+��-�s"�'B�B�A
B�4B�5 B�Bc��K�|j|�}|jj|j||��d{���y7��wr)�_encapsulate�_connection�write�
_stream_id)r�datagram�is_end�datas    r�sendzAsyncioQuicStream.send5s8����� � ��*�����$�$�T�_�_�d�F�C�C�C�s�<A�A�Ac���K�|j||�r@|j4�d{���|jj�ddd��d{���yy7�07�#1�d{���7swYyxYw�wr)�_common_add_inputr�notify)rr8r7s   r�
_add_inputzAsyncioQuicStream._add_input9sf�����!�!�$��/��}�}�
'�
'��
�
�$�$�&�
'�
'�
'�0�
'��
'��
'�
'�
'�sD�#A/�A�A/�A�A/�A�A/�A/�A,� A#�!A,�(A/c��,K�|j�y�wr)�_closers r�closezAsyncioQuicStream.close>s�������
�s�c��K�|S�wr�rs r�
__aenter__zAsyncioQuicStream.__aenter__C���������c���K�|j��d{���|j4�d{���|jj�ddd��d{���y7�D7�17�	#1�d{���7swYyxYw�w�NF)r@rr<)r�exc_type�exc_val�exc_tbs    r�	__aexit__zAsyncioQuicStream.__aexit__Fsg�����j�j�l����=�=�	#�	#��M�M� � �"�	#�	#��	��	#��	#��	#�	#�	#��sT�A6�A�A6�A�A6�A!�
A6�A�A6�A6�A6�!A3�'A*�(A3�/A6r�F)
�__name__�
__module__�__qualname__r
rr!r0r9r=r@rCrK�
__classcell__�rs@rr	r	s1���,�'�
 �&�D�'�
�
�rr	c�T��eZdZd
�fd�	Zd�Zd�Zd�Zd�Zdd�Zd�Z	d
d�Z
d	�Z�xZS)�AsyncioQuicConnectionc����t�|�||||||�d|_tj�|_tj�|_tj�|_d|_	d|_
yr)rr
�_socketr�Event�_handshake_complete�_socket_createdr�_wake_timer�_receiver_task�_sender_task)rr�address�port�source�source_port�managerrs       �rr
zAsyncioQuicConnection.__init__Ns^���
����W�d�F�K��Q����#*�=�=�?�� �&�}�}����"�,�,�.���"��� ��rc	��K�	tjj|j�}tjjd�}|j
|tjd|j|jd|jdf��d{���|_|jj�|j4�d{���|js�|jjt d��d{���\}}|d|jdk7s|d|jdk7r�b|j"j%||t'j&��|j(4�d{���|j(j+�ddd��d{���|js��ddd��d{���d|_|j(4�d{���|j(j+�ddd��d{���|j.j�y7���7��V7��%7��7��#1�d{���7swY��xYw7��#1�d{���7swY��xYw#t,$rY��wxYw7��7�i#1�d{���7swY�yxYw#d|_|j(4�d{���7|j(j+�ddd��d{���7n#1�d{���7swYnxYw|j.j�wxYw�w)Nrr�T)r#�inet�af_for_address�_address�asyncbackend�get_backend�make_socket�socket�
SOCK_DGRAM�_source�_peerrUrX�set�_done�recvfromrr3�receive_datagram�timerY�
notify_all�	ExceptionrW)r�af�backendr6r\s     r�	_receiverzAsyncioQuicConnection._receiverWsq����	+����(�(����7�B��&�&�2�2�9�=�G�")�!4�!4��F�%�%�q�$�,�,����A���
�
�ST�
�8V�"��D�L�
� � �$�$�&��|�|�
6�
6��*�*�04���0E�0E�)�4�1�+�'�X�w��q�z�T�Z�Z��]�2�g�a�j�D�J�J�q�M�6Q� ��$�$�5�5�h������U� $�/�/�6�6��(�(�3�3�5�6�6��*�*�
6�
6��D�J��'�'�
.�
.�� � �+�+�-�
.�
.��$�$�(�(�*�-��
6��+��6��6��6�6�6��
6��
6�
6�
6���	��	��
.��
.��
.�
.�
.���D�J��'�'�
.�
.�� � �+�+�-�
.�
.�
.�
.�
.���$�$�(�(�*�sn�K=�BI�H�3I�H"�
I�0I�H%�A1I�2H(�3I�6H,�I�H*�I�.I�9I�:I�>K=�I'�K=�I+�4K=�?I)�K=�I�"I�%I�(I�*I�,H>	�2H5�3H>	�:I�I�I�	I�
I�I�	I$�!J�#I$�$J�'K=�)K=�+I=�1I4�2I=�9K=�K:�J
�K:�K
�8K:�K�K:�
K�K�K�"K:�:K=c���K�|j4�d{���|jj��d{���ddd��d{���y7�77�7�	#1�d{���7swYyxYw�wr)rYrrs r�_wait_for_wake_timerz*AsyncioQuicConnection._wait_for_wake_timerusZ�����#�#�	*�	*��"�"�'�'�)�)�)�	*�	*�	*��)��	*��	*�	*�	*�rc��rK�|jj��d{���|js�|jj	tj
��}|D]E\}}||jk(sJ�|jj||jd��d{����G|j�\}}	tj|j�|��d{���|j|�|j��d{���|js��yy7��7��7�@#t$rY�IwxYw7�(�wr)rXrrnr3�datagrams_to_sendrqrlrU�sendto�_get_timer_valuesrr!rxrs�
_handle_timer�_handle_events)r�	datagramsr6r\r'�intervals      r�_senderzAsyncioQuicConnection._senderys�����"�"�'�'�)�)�)��*�*��(�(�:�:�4�9�9�;�G�I�%.�
F�!��'��$�*�*�,�,�,��l�l�)�)�(�D�J�J��E�E�E�
F�&*�%;�%;�%=�"�Z��
��&�&�t�'@�'@�'B�H�M�M�M�
���z�*��%�%�'�'�'��*�*�	*��
F��N���
��
��
(�sj�D7�D �BD7�!D"�"D7�<'D&�#D$�$D&�($D7�D5�
D7�D7�"D7�$D&�&	D2�/D7�1D2�2D7c���K�d}	|jj�}|�yt|tjj
j�rX|jj|j�}|�r8|j|j|j��d{����nt|tjj
j�r|jj�n�t|tjj
j �r"d|_|j$j'�not|tjj
j(�rA|jj|j�}|r|jdd��d{���|dz
}|dkDrd}t+j,d��d{������7��:7�27��w)NrTrrb�
)r3�
next_event�
isinstance�aioquic�quic�events�StreamDataReceived�_streamsr.rr=r8�
end_stream�HandshakeCompletedrWrm�ConnectionTerminatedrnrZ�cancel�StreamResetr�sleep)r�count�event�streams    rr~z$AsyncioQuicConnection._handle_events�sg��������$�$�/�/�1�E��}���%����!4�!4�!G�!G�H����*�*�5�?�?�;��� �+�+�E�J�J��8H�8H�I�I�I��E�7�<�<�#6�#6�#I�#I�J��(�(�,�,�.��E�7�<�<�#6�#6�#K�#K�L�!��
��#�#�*�*�,��E�7�<�<�#6�#6�#B�#B�C����*�*�5�?�?�;��� �+�+�C��6�6�6��Q�J�E��r�z����m�m�A�&�&�&�-�J��7��'�s7�B G#�"G�#D	G#�,G�-(G#�G!�G#�G#�!G#c��K�|jj|||�|j4�d{���|jj�ddd��d{���y7�/7�#1�d{���7swYyxYw�wr)r3�send_stream_datarYrr)rr�r8r7s    rr4zAsyncioQuicConnection.write�sh�������)�)�&�$��?��#�#�	*�	*����'�'�)�	*�	*�	*��	*��	*�	*�	*�sD�.A9�A �A9�A$�A9�A"�A9�"A9�$A6�*A-�+A6�2A9c��|jrytj|j��|_tj|j��|_yr)�_closedr�TaskrvrZr�r[rs r�runzAsyncioQuicConnection.run�s;���<�<��%�l�l�4�>�>�+;�<���#�L�L�����8��rc��^K�	tj|jj�|��d{���|jrt�|jjd�}t||�}||j|<|S7�N#t$rt
jj�wxYw�wrG)rr!rWrr"r#r$r%rnrr3�get_next_available_stream_idr	r�)rr(rr�s    r�make_streamz!AsyncioQuicConnection.make_stream�s�����	(��"�"�4�#;�#;�#@�#@�#B�G�L�L�L��:�:����$�$�A�A�%�H�	�"�4��3��#)��
�
�i� ��
�
M���	(��-�-�'�'�'�	(�s,�B-�1B�B�B�A
B-�B�$B*�*B-c��K�|js�|jj|jd|jd�d|_|jj�|jj�|j4�d{���|jj�ddd��d{���	|j�d{���	|j�d{���|jj��d{���yy7�|7�T#1�d{���7swY�dxYw7�V#tj$rY�iwxYw7�\#tj$rY�owxYw7�U�w)NrrbT)r��_manager�closedrlr3r@rXrmrYrrrZr�CancelledErrorr[rUrs rr@zAsyncioQuicConnection.close�s)�����|�|��M�M� � ����A���
�
�1�
�>��D�L����"�"�$�� � �$�$�&��'�'�
.�
.�� � �+�+�-�
.�
.�
��)�)�)�)�
��'�'�'�'��,�,�$�$�&�&�&�!�
.��
.��
.�
.�
.��*���)�)�
��
��(���)�)�
��
��&�s��BE�D
�E�D�/E�:D�;E�D(�D&�D(�E�$E�%E�)E�E�E�E�D#�D�D#�E�&D(�(D>�;E�=D>�>E�E�E�E�E�ErrL)
rMrNrOr
rvrxr�r~r4r�r�r@rPrQs@rrSrSMs0���!�+�<*�
(�'�4*�
9�
�'rrSc�P��eZdZdejdf�fd�	Z	dd�Zd�Zd�Z�xZ	S)�AsyncioQuicManagerNc�2��t�|�||t|�yr)rr
rS)r�conf�verify_mode�server_namers    �rr
zAsyncioQuicManager.__init__�s���
����{�,A�;�Orc�Z�|j|||||�\}}|r|j�|Sr)�_connectr�)rr\r]r^r_�want_session_ticketr�starts        r�connectzAsyncioQuicManager.connect�s8��#�m�m��T�6�;�0C�
���U���N�N���rc��K�|S�wrrBrs rrCzAsyncioQuicManager.__aenter__�rDrEc��K�t|jj��}|D]}|j��d{����y7��wrG)�list�_connections�valuesr@)rrHrIrJ�connectionsrs      rrKzAsyncioQuicManager.__aexit__�sJ�����4�,�,�3�3�5�6��%�	%�J��"�"�$�$�$�	%��
%�s�<A�A�A)iUNrT)
rMrNrO�ssl�
CERT_REQUIREDr
r�rCrKrPrQs@rr�r��s,��� �c�.?�.?�T�P�RV���rr�)rrir�r,rq�aioquic.quic.configurationr��aioquic.quic.connection�aioquic.quic.events�dns.asyncbackendr#�
dns.exception�dns.inet�dns.quic._commonrrrrrr	rSr�rBrr�<module>r�s\���
�
�
��!��������1��1�h}'�/�}'�@�)�r

Zerion Mini Shell 1.0