%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__/_trio.cpython-312.pyc

�

5��e����ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z
ddlZ
ddlm
Z
ddlmZmZmZmZmZGd�de�ZGd�de�ZGd�d	e�Zy)
�N)�NullContext)�QUIC_MAX_DATAGRAM�AsyncQuicConnection�AsyncQuicManager�BaseQuicStream�
UnexpectedEOFc�L��eZdZ�fd�Zd�Zd	d�Zd
d�Zd�Zd�Zd�Z	d�Z
�xZS)�TrioQuicStreamc�X��t�|�||�tj�|_y�N)�super�__init__�trio�	Condition�_wake_up)�self�
connection�	stream_id�	__class__s   ��0/usr/lib/python3/dist-packages/dns/quic/_trio.pyrzTrioQuicStream.__init__s ���
����Y�/����(��
�c��&K�	|jj|�ry||_|j4�d{���|jj	��d{���ddd��d{���d|_�r7�>7�7�#1�d{���7swY� xYw�w)Nr)�_buffer�have�
_expectingr�wait)r�amounts  r�wait_forzTrioQuicStream.wait_fors�������|�|� � ��(��$�D�O��}�}�
+�
+��m�m�(�(�*�*�*�
+�
+��D�O�
�
+��*��
+��
+�
+�
+�sV�5B�A6�B�A<�A8�A<�B�)A:�*
B�8A<�:B�<B�B�B�
Bc��K�|�td�}ntj|�}|5|jd��d{���t	j
d|jjd��\}|j|��d{���|jj|�cddd�S7�r7�*#1swYtjj�xYw�w)N�z!H)rr�
move_on_afterr�struct�unpackr�get�dns�	exception�Timeout)r�timeout�context�sizes    r�receivezTrioQuicStream.receive's������?�!�$�'�G��(�(��1�G�
�	*��-�-��"�"�"��m�m�D�$�,�,�*:�*:�1�*=�>�G�T��-�-��%�%�%��<�<�#�#�D�)�		*�	*�"��%��	*�
�m�m�#�#�#�s?�&C�B4�B0�A	B4�B2�B4�&
C�0B4�2B4�4C�9 Cc��K�|j|�}|jj|j||��d{���y7��wr)�_encapsulate�_connection�write�
_stream_id)r�datagram�is_end�datas    r�sendzTrioQuicStream.send3s8����� � ��*�����$�$�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)rr3r2s   r�
_add_inputzTrioQuicStream._add_input7sf�����!�!�$��/��}�}�
'�
'��
�
�$�$�&�
'�
'�
'�0�
'��
'��
'�
'�
'�sD�#A/�A�A/�A�A/�A�A/�A/�A,� A#�!A,�(A/c��,K�|j�y�wr)�_close�rs r�closezTrioQuicStream.close<s�������
�s�c��K�|S�wr�r;s r�
__aenter__zTrioQuicStream.__aenter__A���������c���K�|j��d{���|j4�d{���|jj�ddd��d{���y7�D7�17�	#1�d{���7swYyxYw�w�NF)r<rr7)r�exc_type�exc_val�exc_tbs    r�	__aexit__zTrioQuicStream.__aexit__Dsg�����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__rrr+r4r8r<r?rG�
__classcell__�rs@rr
r
s,���)� �
$�D�'�
�
�rr
c�H��eZdZd�fd�	Zd�Zd�Zd	d�Zd�Zdd�Zd�Z	�xZ
S)
�TrioQuicConnectionc�*��t�|�||||||�tjj|jtj
d�|_tj�|_tj�|_	d|_
d|_y)NrF)r
rr�socket�_af�
SOCK_DGRAM�_socket�Event�_handshake_complete�	_run_done�
_worker_scope�
_send_pending)rr�address�port�source�source_port�managerrs       �rrzTrioQuicConnection.__init__Lsi���
����W�d�F�K��Q��{�{�)�)�$�(�(�F�4E�4E�q�I���#'�:�:�<�� �������!���"��rc��K�	|jrU|jjtjj|j|j���d{���|jj|j��d{���|j�sZ|jd�\}}|jrd}tjtj�|z��5|_|jj!t"��d{���}|j$j'||jt)j(��ddd�d|_|j+|�|j-��d{���d|_|j$j/t)j(��}|D](\}}|jj1|��d{����*|js��Zd|_	|j2j5�y7���7���7��
#1swY��xYw7��7�M#d|_	|j2j5�wxYw�w)NFg)�deadlineT)�_sourcerT�bindr%�inet�low_level_address_tuplerR�connect�_peer�_done�_get_timer_valuesrYr�CancelScope�current_timerX�recvrr.�receive_datagram�time�
_handle_timer�_handle_events�datagrams_to_sendr4rV�set)r�
expiration�intervalr1�	datagrams�_s      r�_workerzTrioQuicConnection._workerTs�����!	+��|�|��l�l�'�'��H�H�4�4�T�\�\�4�8�8�L�����,�,�&�&�t�z�z�2�2�2��j�j�)-�)?�)?��)F�&��X��%�%� #�H��%�%�!�.�.�0�8�;��Y��'�%)�\�\�%6�%6�7H�%I�I�H��$�$�5�5�h��
�
�D�I�I�K�X�	Y�
&*��"��"�"�:�.��)�)�+�+�+�&+��"� �,�,�>�>�t�y�y�{�K�	�#,�6�K�H�a��,�,�+�+�H�5�5�5�6�/�j�j�4�D�J��$�$�(�(�*�?��
3�� J��Y�Y��,��6���D�J��$�$�(�(�*�s��I�AH4� H�!,H4�
H�AH4�,(H$�H!�=H$�3H4�H0�AH4�$H2�%H4�9"I�H4�H4�!H$�$H-�)H4�2H4�4#I�Ic���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)NrTr��
)r.�
next_event�
isinstance�aioquic�quic�events�StreamDataReceived�_streamsr$rr8r3�
end_stream�HandshakeCompletedrVrq�ConnectionTerminatedrgrTr<�StreamResetr�sleep)r�count�event�streams    rroz!TrioQuicConnection._handle_eventsxsd��������$�$�/�/�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����j�j��m�#�#�+�J��7��
$�s7�B G#�"G�#D	G#�,G�-(G#�G!�G#�G#�!G#c��K�|jj|||�d|_|j�|jj	�yy�w)NT)r.�send_stream_datarYrX�cancel)rr�r3r2s    rr/zTrioQuicConnection.write�sI�������)�)�&�$��?�!������)����%�%�'�*�s�A
Ac��K�|jrytj�4�d{���}|j|j�ddd��d{���|j
j
�y7�J7�!#1�d{���7swY�1xYw�wr)�_closedr�open_nursery�
start_soonrvrWrq)r�nurserys  r�runzTrioQuicConnection.run�so�����<�<���$�$�&�	-�	-�'����t�|�|�,�	-�	-�������	-��	-��	-�	-�	-�sD�&B�A3�B�A7�B�A5� B�5B�7B	�=B�>B	�Bc��K�|�td�}ntj|�}|5|jj	��d{���|j
rt�|jjd�}t||�}||j|<|cddd�S7�W#1swYtjj�xYw�wrC)rrr!rVrrgrr.�get_next_available_stream_idr
r�r%r&r')rr(r)rr�s     r�make_streamzTrioQuicConnection.make_stream�s������?�!�$�'�G��(�(��1�G�
�	��*�*�/�/�1�1�1��z�z�#�#��(�(�E�E�e�L�I�#�D�)�4�F�'-�D�M�M�)�$��	�	�1��	��m�m�#�#�#�s/�&C�B �B�A
B �
C�B � C�% Cc��vK�|js�|jj|jd|jd�d|_|jj�d|_|j�|jj�|jj��d{���yy7��w)NrrxT)r��_manager�closedrfr.r<rYrXr�rWrr;s rr<zTrioQuicConnection.close�s������|�|��M�M� � ����A���
�
�1�
�>��D�L����"�"�$�!%�D���!�!�-��"�"�)�)�+��.�.�%�%�'�'�'��
(�s�B.B9�0B7�1B9rrH)rIrJrKrrvror/r�r�r<rLrMs@rrOrOKs'���#�"+�H$�2(��
$�(rrOc�P��eZdZdejdf�fd�	Z	dd�Zd�Zd�Z�xZ	S)�TrioQuicManagerNc�@��t�|�||t|�||_yr)r
rrO�_nursery)rr��conf�verify_mode�server_namers     �rrzTrioQuicManager.__init__�s ���	����{�,>��L���
rc��|j|||||�\}}|r%|jj|j�|Sr)�_connectr�r�r�)rrZr[r\r]�want_session_ticketr�starts        rrezTrioQuicManager.connect�sD��#�m�m��T�6�;�0C�
���U���M�M�$�$�Z�^�^�4��rc��K�|S�wrr>r;s rr?zTrioQuicManager.__aenter__�r@rAc��K�t|jj��}|D]}|j��d{����y7��wrC)�list�_connections�valuesr<)rrDrErF�connectionsrs      rrGzTrioQuicManager.__aexit__�sJ�����4�,�,�3�3�5�6��%�	%�J��"�"�$�$�$�	%��
%�s�<A�A�A)iUNrT)
rIrJrK�ssl�
CERT_REQUIREDrrer?rGrLrMs@rr�r��s+��� �c�.?�.?�T� �RV���rr�)rQr�r"rm�aioquic.quic.configurationr|�aioquic.quic.connection�aioquic.quic.eventsr�
dns.exceptionr%�dns.inet�dns._asyncbackendr�dns.quic._commonrrrrrr
rOr�r>rr�<module>r�s\���
�
��!������)���/�^�/�dj(�,�j(�Z�&�r

Zerion Mini Shell 1.0