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

�

5��e����ddlZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddl
mZmZmZmZmZeed�r
ej(Znej,ZGd�de�ZGd�de�ZGd�d	e�Zy)
�N)�QUIC_MAX_DATAGRAM�BaseQuicConnection�BaseQuicManager�BaseQuicStream�
UnexpectedEOF�PollSelectorc�L��eZdZ�fd�Zd�Zd	d�Zd
d�Zd�Zd�Zd�Z	d�Z
�xZS)�SyncQuicStreamc���t�|�||�tj�|_tj
�|_y�N)�super�__init__�	threading�	Condition�_wake_up�Lock�_lock)�self�
connection�	stream_id�	__class__s   ��0/usr/lib/python3/dist-packages/dns/quic/_sync.pyrzSyncQuicStream.__init__ s0���
����Y�/�!�+�+�-��
��^�^�%��
�c�~�	|j|�}|j5|jj|�r
	ddd�y||_ddd�|j
5|j
j
|�stjj�	ddd�d|_��#1swY�\xYw#1swY�xYw)Nr)
�_timeout_from_expirationr�_buffer�have�
_expectingr�wait�dns�	exception�Timeout)r�amount�
expiration�timeouts    r�wait_forzSyncQuicStream.wait_for%s�����3�3�J�?�G����
)��<�<�$�$�V�,��
)�
)�#)���
)����
0��}�}�)�)�'�2��-�-�/�/�/�3�
0� �D�O��
)�
)��
0�
0�s�B'�B'� 6B3�'B0�3B<c��|j|�}|jd|�|j5tjd|j
j
d��\}ddd�|j|�|j5|j
j
|�cddd�S#1swY�LxYw#1swYyxYw)N�z!H)�_expiration_from_timeoutr&r�struct�unpackr�get)rr%r$�sizes    r�receivezSyncQuicStream.receive1s����2�2�7�;�
��
�
�a��$�
�Z�Z�	?��m�m�D�$�,�,�*:�*:�1�*=�>�G�T�	?��
�
�d�J�'�
�Z�Z�	*��<�<�#�#�D�)�	*�	*�	?�	?��	*�	*�s�2B-�B9�-B6�9Cc�t�|j|�}|jj|j||�yr)�_encapsulate�_connection�write�
_stream_id)r�datagram�is_end�datas    r�sendzSyncQuicStream.send:s.��� � ��*�������t����f�=rc��|j||�r0|j5|jj�ddd�yy#1swYyxYwr)�_common_add_inputr�notify)rr6r5s   r�
_add_inputzSyncQuicStream._add_input>sH���!�!�$��/����
'��
�
�$�$�&�
'�
'�0�
'�
'�s�A�A
c�f�|j5|j�ddd�y#1swYyxYwr)r�_close�rs r�closezSyncQuicStream.closeCs'��
�Z�Z�	��K�K�M�	�	�	�s�'�0c��|Sr�r>s r�	__enter__zSyncQuicStream.__enter__G����rc��|j�|j5|jj�ddd�y#1swYyxYw�NF)r?rr:)r�exc_type�exc_val�exc_tbs    r�__exit__zSyncQuicStream.__exit__Js8���
�
��
�]�]�	#��M�M� � �"�	#��	#��s�A�A
r�F)�__name__�
__module__�__qualname__rr&r.r7r;r?rBrI�
__classcell__�rs@rr
r
s+���&�

 �*�>�'�
��rr
c�\��eZdZ�fd�Zd�Zd�Zd�Zd�Zdd�Zd�Z	dd�Z
�fd	�Zd
�Z�xZ
S)
�SyncQuicConnectionc���t�|�||||||�tj|jtjd�|_|j�N	|j
jtjj|j|j��|j
j|j�tj�\|_|_|j"j%d�|j
j%d�t'j(�|_d|_t'j.�|_y#t$r|j
j��wxYw)NrF)r
r�socket�_af�
SOCK_DGRAM�_socket�_source�bindr �inet�low_level_address_tuple�	Exceptionr?�connect�_peer�
socketpair�_send_wakeup�_receive_wakeup�setblockingr�Event�_handshake_complete�_worker_threadrr)rr�address�port�source�source_port�managerrs       �rrzSyncQuicConnection.__init__Rs���
����W�d�F�K��Q��}�}�T�X�X�v�/@�/@�!�D����<�<�#�
����!�!��H�H�4�4�T�\�\�4�8�8�L��	
�����T�Z�Z�(�4:�4E�4E�4G�1��	�D�0����(�(��/���� � ��'�#,�?�?�#4�� �"����^�^�%��
���
����"�"�$��
�s
�A
E�%E?c�<�d}|dkrz|dz
}	|jjt�}|j5|j
j
||jtj��ddd�|dkr�yyy#t$rYywxYw#1swY� xYw)Nr�
�)	rV�recvr�BlockingIOErrorrr1�receive_datagramr]�time)r�countr4s   r�_readzSyncQuicConnection._reades������b�j��Q�J�E�
��<�<�,�,�->�?�����
U�� � �1�1�(�D�J�J��	�	��T�
U�
�b�j��#�
��
��
U�
U�s�B�:B�	B�B�Bc�\�		|jjd��#t$rYywxYw)N� )r`rmrnr>s r�
_drain_wakeupz SyncQuicConnection._drain_wakeupps7���
��$�$�)�)�"�-���#�
��
�s��	+�+c�<�	t�}|j|jtj|j
�|j|jtj|j�|js�|jd�\}}|j|�}|D]\}}|j��|j5|j|�ddd�|j�|j5|jj!t#j"��}ddd�D]!\}}	|jj%|��#|js��|j5d|_ddd�|j(j+�y#1swY��xYw#1swY�xYw#t&$rY��wxYw#1swY�KxYw#|j5d|_ddd�n#1swYnxYw|j(j+�wxYw)NFT)�_selector_class�registerrV�	selectors�
EVENT_READrrr`ru�_done�_get_timer_values�selectr6r�
_handle_timer�_handle_eventsr1�datagrams_to_sendrpr7rnrc�set)	r�selr$�interval�items�key�_�	datagramsr4s	         r�_workerzSyncQuicConnection._workerws���	+�!�#�C��L�L����y�';�';�T�Z�Z�H��L�L��-�-�y�/C�/C�T�EW�EW�X��j�j�)-�)?�)?��)F�&��X��
�
�8�,��#��F�C���H�H�J���Z�Z�3��&�&�z�2�3��#�#�%��Z�Z�P� $� 0� 0� B� B�4�9�9�;� O�I�P�#,��K�H�a�����)�)�(�3���j�j�"���
"�!��
�
"�
�$�$�(�(�*�3�3��P�P��
+�����
"�
"�����
"�!��
�
"�
"�
"��
�$�$�(�(�*�s��CG�
F#�$G�.F/�1G�F;�G�8G
�#F,�(G�/F8�4G�;	G�G�G�G�
G�
H�#G4�+	H�4G=�9"Hc��	|j5|jj�}ddd��yt|tj
jj�re|j5|jj|j�}ddd��r8|j|j|j��nt|tj
jj�r|jj!�n�t|tj
jj"�r|j5d|_ddd�n|t|tj
jj&�rN|j5|jj|j�}ddd�r|jdd����#1swY���xYw#1swY��TxYw#1swY�%xYw#1swY�ExYw)NTr)rr1�
next_event�
isinstance�aioquic�quic�events�StreamDataReceived�_streamsr,rr;r6�
end_stream�HandshakeCompletedrcr��ConnectionTerminatedr{�StreamReset)r�event�streams   rrz!SyncQuicConnection._handle_events�s�������
6��(�(�3�3�5��
6��}���%����!4�!4�!G�!G�H��Z�Z�@�!�]�]�.�.�u���?�F�@���%�%�e�j�j�%�2B�2B�C��E�7�<�<�#6�#6�#I�#I�J��(�(�,�,�.��E�7�<�<�#6�#6�#K�#K�L��Z�Z�&�!%�D�J�&�&��E�7�<�<�#6�#6�#B�#B�C��Z�Z�@�!�]�]�.�.�u���?�F�@���%�%�c�4�0�'�
6�
6��
@�@��&�&��@�@�s/�G�.&G&�
G3�&G?�G#�&G0�3G<�?Hc��|j5|jj|||�ddd�|jj	d�y#1swY�%xYw)N�)rr1�send_stream_datar_r7)rr�r6r5s    rr2zSyncQuicConnection.write�sN��
�Z�Z�	D����-�-�f�d�F�C�	D������w�'�	D�	D�s�A�Ac��|jrytj|j��|_|jj�y)N)�target)�_closedr�Threadr�rd�startr>s r�runzSyncQuicConnection.run�s5���<�<��'�.�.�d�l�l�C������!�!�#rc�D�|jj|�stjj�|j
5|jrt�|jjd�}t||�}||j|<ddd�|S#1swYSxYwrE)rcrr r!r"rr{rr1�get_next_available_stream_idr
r�)rr%rr�s    r�make_streamzSyncQuicConnection.make_stream�s����'�'�,�,�W�5��-�-�'�'�'�
�Z�Z�	.��z�z�#�#��(�(�E�E�e�L�I�#�D�)�4�F�'-�D�M�M�)�$�	.��
�
	.��
�s
�A	B�Bc�f��|j5t�|�	|�ddd�y#1swYyxYwr)rr
�close_stream)rrrs  �rr�zSyncQuicConnection.close_stream�s,���
�Z�Z�	,��G� ��+�	,�	,�	,�s�'�0c��|j5|jr
	ddd�y|jj|jd|jd�d|_|j
j
�|jjd�ddd�|jj�y#1swY�$xYw)NrrlTr�)rr��_manager�closedr]r1r?r_r7rd�joinr>s rr?zSyncQuicConnection.close�s���
�Z�Z�	,��|�|��	,�	,�
�M�M� � ����A���
�
�1�
�>��D�L����"�"�$����"�"�7�+�
	,�	
��� � �"�	,�	,�s�B9�A2B9�9CrJr)rKrLrMrrrrur�rr2r�r�r�r?rNrOs@rrQrQQs6���&�&	U��+�61�,(�
$�	�,�#rrQc�d��eZdZdejdf�fd�	Z	dd�Z�fd�Z�fd�Zd�Z	d�Z
�xZS)	�SyncQuicManagerNc�d��t�|�||t|�tj�|_yr)r
rrQrrr)r�conf�verify_mode�server_namers    �rrzSyncQuicManager.__init__�s%���
����{�,>��L��^�^�%��
rc��|j5|j|||||�\}}|r|j�|cddd�S#1swYyxYwr)r�_connectr�)rrerfrgrh�want_session_ticketrr�s        rr\zSyncQuicManager.connect�sQ���Z�Z�	�"&�-�-���v�{�4G�#��Z������ ��
	�	�	�s�,A�Ac�h��|j5t�|�	||�ddd�y#1swYyxYwr)rr
r�)rrerfrs   �rr�zSyncQuicManager.closed�s-���
�Z�Z�	*��G�N�7�D�)�	*�	*�	*�s�(�1c�j��|j5t�|�	|||�ddd�y#1swYyxYwr)rr
�save_session_ticket)rrerf�ticketrs    �rr�z#SyncQuicManager.save_session_ticket�s0���
�Z�Z�	?��G�'���v�>�	?�	?�	?�s�)�2c��|SrrAr>s rrBzSyncQuicManager.__enter__�rCrc�x�t|jj��}|D]}|j��yrE)�list�_connections�valuesr?)rrFrGrH�connectionsrs      rrIzSyncQuicManager.__exit__�s;���4�,�,�3�3�5�6��%�	�J�����	�r)iUNrT)rKrLrM�ssl�
CERT_REQUIREDrr\r�r�rBrIrNrOs@rr�r��s5��� �c�.?�.?�T�&�
RV�	�*�?��rr�)ryrSr�r*rrp�aioquic.quic.configurationr��aioquic.quic.connection�aioquic.quic.events�
dns.exceptionr �dns.inet�dns.quic._commonrrrrr�hasattrrrw�SelectSelectorr
rQr�rArr�<module>r�s}���
�
�
���!��������9�n�%��,�,�O��.�.�O�/�^�/�dy#�+�y#�x!�o�!r

Zerion Mini Shell 1.0