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

�

5��er���ddlZddlZddlZddlZddlZddlmZmZddlZ	ddl
Z	ddlZdZ
dZedzZGd�de�ZGd�d	�ZGd
�d�ZGd�d
�ZGd�de�ZGd�d�ZGd�de�Zy)�N)�Any�Optionali��c��eZdZy)�
UnexpectedEOFN)�__name__�
__module__�__qualname__���2/usr/lib/python3/dist-packages/dns/quic/_common.pyrrs��r
rc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�Bufferc� �d|_d|_y)Nr
F)�_buffer�	_seen_end��selfs r�__init__zBuffer.__init__s�������r
c�\�|jry|xj|z
c_|rd|_yy)NT)rr�r�data�is_ends   r�putz
Buffer.puts)���>�>���������!�D�N�r
c�Z�t|j�|k\ry|jrt�y)NTF)�lenrrr)r�amounts  r�havezBuffer.have&s&���t�|�|���&���>�>���r
c��|jS�N)rrs r�seen_endzBuffer.seen_end-s���~�~�r
c�r�|j|�sJ�|jd|}|j|d|_|Sr!)rr)rrrs   r�getz
Buffer.get0s;���y�y�� � � ��|�|�G�V�$���|�|�F�G�,����r
N)r	r
rrrrr"r$rr
rrrs���"���r
rc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�BaseQuicStreamc�L�||_||_t�|_d|_y�Nr)�_connection�
_stream_idrr�
_expecting)r�
connection�	stream_ids   rrzBaseQuicStream.__init__8s!��%���#����x�����r
c��|jSr!)r*rs r�idzBaseQuicStream.id>s�����r
c�@�|�tj�|z}|Sd}|Sr!)�time)r�timeout�
expirations   r�_expiration_from_timeoutz'BaseQuicStream._expiration_from_timeoutAs-��������w�.�J����J��r
c�T�|�#t|tj�z
d�}|Sd}|S)Ng)�maxr1)rr3r2s   r�_timeout_from_expirationz'BaseQuicStream._timeout_from_expirationHs2���!��*�t�y�y�{�2�C�8�G����G��r
c�J�t|�}tjd|�|zS)Nz!H)r�struct�pack)r�datagram�ls   r�_encapsulatezBaseQuicStream._encapsulateRs!����M���{�{�4��#�h�.�.r
c���|jj||�	|jdkDxr%|jj|j�S#t$rYywxYw)NrT)rrr+rrrs   r�_common_add_inputz BaseQuicStream._common_add_inputVsT��������v�&�	��?�?�Q�&�M�4�<�<�+<�+<�T�_�_�+M�M���	��	�s�5A�	A �A c��|jj|j�|jj	dd�y)Nr
T)r)�close_streamr*rrrs r�_closezBaseQuicStream._close]s.�����%�%�d�o�o�6�������d�#r
N)
r	r
rrr/r4r7r=r?rBrr
rr&r&7s%������/��$r
r&c�*�eZdZ	dd�Zd�Zdd�Zd�Zy)�BaseQuicConnectionNc��d|_||_||_||_d|_||_i|_tjj|�|_
tjj||f�|_|�K|dk7rF|jtjk(rd}n&|jtjk(rd}nt �|r
||f|_yd|_y)NFrz0.0.0.0z::)�_doner)�_address�_port�_closed�_manager�_streams�dns�inet�af_for_address�_af�low_level_address_tuple�_peer�socket�AF_INET�AF_INET6�NotImplementedError�_source)rr,�address�port�source�source_port�managers       rrzBaseQuicConnection.__init__cs�����
�%�����
���
������
���
��8�8�*�*�7�3����X�X�5�5�w��o�F��
��>�k�Q�.��x�x�6�>�>�)�"�����V�_�_�,���)�)��"�K�0�D�L��D�Lr
c��|j|=yr!)rK)rr-s  rrAzBaseQuicConnection.close_stream{s���M�M�)�$r
c���tj�}|jj�}|�|dz}t||z
d�}|jr|rt|d�}||fS)Nirg�������?)r1r)�	get_timerr6rI�min)r�closed_is_special�nowr3�intervals     r�_get_timer_valuesz$BaseQuicConnection._get_timer_values~sd���i�i�k���%�%�/�/�1�
����t��J��z�C�'��+���<�<�-��8�T�*�H��H�%�%r
c�n�tj�}||kr|jj|�yyr!)r1r)�handle_timer)rr3ras   r�
_handle_timerz BaseQuicConnection._handle_timer�s.���i�i�k��������)�)�#�.�r
)NrN)T)r	r
rrrArcrfrr
rrDrDbs��MQ� �0%�&�/r
rDc�$�eZdZddeedefd�Zy)�AsyncQuicConnectionNr2�returnc��K�y�wr!r)rr2s  r�make_streamzAsyncQuicConnection.make_stream�s	�����s�r!)r	r
rr�floatrrkrr
rrhrh�s��
��%��
�C�
r
rhc�*�eZdZdd�Z	dd�Zd�Zd�Zy)�BaseQuicManagerNc���i|_||_i|_|�Wd}t|t�r|}d}t
jjjddg||��}|�|j|�||_
y)NT�doqzdoq-i03)�alpn_protocols�verify_mode�server_name)�_connections�_connection_factory�_session_tickets�
isinstance�str�aioquic�quic�
configuration�QuicConfiguration�load_verify_locations�_conf)r�confrr�connection_factoryrs�verify_paths      rrzBaseQuicManager.__init__�s������#5�� � "����<��K��+�s�+�)��"���<�<�-�-�?�?� %�y�1�'�'�@��D�
�&��*�*�;�7���
r
c�t�|jj||f�}|�|dfS|j}|r\	|jj	||f�}tj
|�}||_tj|j||�}	nd}	tjjj||	��}
tj j#||f�}|
j%|t'j&��|j)|
|||||�}||j||f<|dfS#t$rY��wxYw)NF)r{�session_ticket_handlerT)rtr$r~rv�pop�copy�session_ticket�KeyError�	functools�partial�save_session_ticketryrzr,�QuicConnectionrLrMrP�connectr1ru)rrWrXrYrZ�want_session_ticketr,rr�r��qconn�	lladdresss            r�_connectzBaseQuicManager._connect�s<���&�&�*�*�G�T�?�;�
��!���&�&��z�z���
�!%�!6�!6�!:�!:�G�T�?�!K���y�y����&4��#�&/�%6�%6��(�(�'�4�&�"�&*�"����'�'�6�6��#9�7�
���H�H�4�4�g�t�_�E�	�
�
�
�i�����-��-�-��7�D�&�+�t�
�
�.8����7�D�/�*��D�!�!��)�
��
�s�9D+�+	D7�6D7c�B�	|j||f=y#t$rYywxYwr!)rtr�)rrWrXs   r�closedzBaseQuicManager.closed�s+��	��!�!�7�D�/�2���	��	�s��	�c���t|j�}|tk\r>t|jj	��dt
}|D]}|j|=�||j||f<yr()rrv�MAX_SESSION_TICKETS�list�keys�SESSIONS_TO_DELETE)rrWrX�ticketr<�keys_to_delete�keys       rr�z#BaseQuicManager.save_session_ticket�so��
��%�%�&���#�#�!�$�"7�"7�"<�"<�">�?��BT�U�N�%�
/���)�)�#�.�
/�17����w��o�.r
r!)�UNrT)r	r
rrr�r�r�rr
rrnrn�s���&RV�!"�F�	8r
rnc��eZdZdd�Zy)�AsyncQuicManagerNc��t�r!)rU)rrWrXrYrZs     rr�zAsyncQuicManager.connect�s��!�!r
)r�Nr)r	r
rr�rr
rr�r��s��"r
r�)r�r�rRr9r1�typingrr�aioquic.quic.configurationry�aioquic.quic.connection�dns.inetrL�QUIC_MAX_DATAGRAMr�r��	Exceptionrrr&rDrhrnr�rr
r�<module>r�s�����
�
�� �!�������)�A�-��	�I�	���:($�($�V,/�,/�^
�,�
�
E8�E8�P"��"r

Zerion Mini Shell 1.0