Your IP : 3.133.127.131


Current Path : /opt/alt/python311/lib64/python3.11/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/asyncio/__pycache__/streams.cpython-311.opt-2.pyc

�

c��fok��~�dZddlZddlZddlZddlZddlZeed��redz
ZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddl
mZddlmZd
Zded�d�Zded�d�Zeed��rded�d�Zded�d�ZGd�dej��ZGd�deej��ZGd�d��ZGd�d��ZdS))�StreamReader�StreamWriter�StreamReaderProtocol�open_connection�start_server�N�AF_UNIX)�open_unix_connection�start_unix_server�)�
coroutines)�events)�
exceptions)�format_helpers)�	protocols)�logger)�sleepi)�limitc����	K�	tj��}t||���}t||����	|j�	fd�||fi|���d{V��\}}t|�	||��}||fS)N�r�loop�rc����S�N���protocols��6/opt/alt/python311/lib64/python3.11/asyncio/streams.py�<lambda>z!open_connection.<locals>.<lambda>1s�����)r
�get_running_looprr�create_connectionr)
�host�portr�kwdsr�reader�	transport�_�writerrs
         @rrrs�������"�"�$�$�D�
��D�
1�
1�
1�F�#�F��6�6�6�H�/��/�����$��.�.�(,�.�.�.�.�.�.�.�.�L�I�q�
�)�X�v�t�
<�
<�F��6�>�rc��n���K�	tj������fd�}�j|||fi|���d{V��S)Nc�N��t�����}t|�����}|S�Nrr�rr�r%r�client_connected_cbrrs  ���r�factoryzstart_server.<locals>.factoryNs6����E��5�5�5��'��0C�-1�3�3�3���r)r
r �
create_server)r.r"r#rr$r/rs`  `  @rrr6st��������(�"�$�$�D��������$��#�G�T�4�@�@�4�@�@�@�@�@�@�@�@�@rc����K�	tj��}t||���}t||����|j�fd�|fi|���d{V��\}}t|�||��}||fS)Nrrc����Srrrs�rrz&open_unix_connection.<locals>.<lambda>bs���H�r)r
r rr�create_unix_connectionr)	�pathrr$rr%r&r'r(rs	        @rr	r	Zs������N��&�(�(���E��5�5�5��'��T�:�:�:��8�T�8�����d�,�,�&*�,�,�,�,�,�,�,�,��	�1��i��6�4�@�@���v�~�rc��l���K�	tj������fd�}�j||fi|���d{V��S)Nc�N��t�����}t|�����}|Sr+r,r-s  ���rr/z"start_unix_server.<locals>.factoryks6���!��D�9�9�9�F�+�F�4G�15�7�7�7�H��Or)r
r �create_unix_server)r.r4rr$r/rs` `  @rr
r
fsn�������K��&�(�(��	�	�	�	�	�	�	�-�T�,�W�d�C�C�d�C�C�C�C�C�C�C�C�Crc�6�eZdZ	dd�Zd�Zd�Zd�Zd�Zd�ZdS)	�FlowControlMixinNc��|�tjd���|_n||_d|_t	j��|_d|_dS)N�)�
stacklevelF)r
�_get_event_loop�_loop�_paused�collections�deque�_drain_waiters�_connection_lost)�selfrs  r�__init__zFlowControlMixin.__init__~sK���<��/�1�=�=�=�D�J�J��D�J����)�/�1�1��� %����rc�t�d|_|j���rtjd|��dSdS)NTz%r pauses writing)r?r>�	get_debugr�debug�rDs r�
pause_writingzFlowControlMixin.pause_writing�sB������:���!�!�	4��L�,�d�3�3�3�3�3�	4�	4rc���d|_|j���rtjd|��|jD]+}|���s|�d���,dS)NFz%r resumes writing)r?r>rGrrHrB�done�
set_result�rD�waiters  r�resume_writingzFlowControlMixin.resume_writing�ss������:���!�!�	5��L�-�t�4�4�4��)�	(�	(�F��;�;�=�=�
(��!�!�$�'�'�'��	(�	(rc��d|_|jsdS|jD]C}|���s-|�|�d���.|�|���DdS�NT)rCr?rBrLrM�
set_exception�rD�excrOs   r�connection_lostz FlowControlMixin.connection_lost�sv�� $����|�	��F��)�	.�	.�F��;�;�=�=�
.��;��%�%�d�+�+�+�+��(�(��-�-�-��	.�	.rc��2K�|jrtd���|jsdS|j���}|j�|��	|�d{V��|j�|��dS#|j�|��wxYw)NzConnection lost)rC�ConnectionResetErrorr?r>�
create_futurerB�append�removerNs  r�
_drain_helperzFlowControlMixin._drain_helper�s������ �	:�&�'8�9�9�9��|�	��F���)�)�+�+����"�"�6�*�*�*�	/��L�L�L�L�L�L�L���&�&�v�.�.�.�.�.��D��&�&�v�.�.�.�.���s�A:�:Bc��t�r)�NotImplementedError�rD�streams  r�_get_close_waiterz"FlowControlMixin._get_close_waiter�s��!�!rr)	�__name__�
__module__�__qualname__rErJrPrVr\rarrrr9r9tsx�������&�&�&�&�4�4�4�(�(�(�.�.�.�
/�
/�
/�"�"�"�"�"rr9c�j��eZdZ	dZd�fd�	Zed���Zd�Zd�Z�fd�Z	d�Z
d�Zd	�Zd
�Z
�xZS)rNc�L��t���|���|�&tj|��|_|j|_nd|_|�||_d|_d|_d|_	d|_
||_d|_|j
���|_dS)NrF)�superrE�weakref�ref�_stream_reader_wr�_source_traceback�_strong_reader�_reject_connection�_stream_writer�_task�
_transport�_client_connected_cb�	_over_sslr>rY�_closed)rD�
stream_readerr.r�	__class__s    �rrEzStreamReaderProtocol.__init__�s����
�����d��#�#�#��$�%,�[��%?�%?�D�"�%2�%D�D�"�"�%)�D�"��*�#0�D��"'���"�����
����$7��!�����z�/�/�1�1����rc�<�|j�dS|���Sr)rjrIs r�_stream_readerz#StreamReaderProtocol._stream_reader�s"���!�)��4��%�%�'�'�'rc�v�|j}|j}||_||_|�d��du|_dS)N�
sslcontext)r>r&rnrp�get_extra_inforr)rDr(rr&s    r�_replace_writerz$StreamReaderProtocol._replace_writer�s>���z���$�	�$���#���"�1�1�,�?�?�t�K����rc�X����jrEddi}�jr
�j|d<�j�|������dS��_�j}|�|������d��du�_	�j
��t��|�j���_��
|�j��}tj|��r?��fd�}�j�|���_�j�|��d�_dSdS)N�messagezpAn open stream was garbage collected prior to establishing network connection; call "stream.close()" explicitly.�source_tracebackryc����|���r����dS|���}|�4�j�d|�d�������dSdS)Nz*Unhandled exception in client_connected_cb)r}�	exceptionr&)�	cancelled�closer�r>�call_exception_handler)�taskrUrDr&s  ��r�callbackz6StreamReaderProtocol.connection_made.<locals>.callback�s�����~�~�'�'��!���)�)�)����.�.�*�*�C����
�9�9�'S�),�)2�;�;����
"���)�)�)�)�)�
'�r)rmrkr>r��abortrprw�
set_transportrzrrrqrrnr�iscoroutine�create_taskro�add_done_callbackrl)rDr&�contextr%�resr�s``    r�connection_madez$StreamReaderProtocol.connection_made�sg�����"�
	��@��G�
�%�
E�.2�.D��*�+��J�-�-�g�6�6�6��O�O�����F�#����$����� � ��+�+�+�"�1�1�,�?�?�t�K����$�0�".�y�$�/5�/3�z�#;�#;�D���+�+�F�,0�,?�A�A�C��%�c�*�*�
7�*�*�*�*�*�*�"�Z�3�3�C�8�8��
��
�,�,�X�6�6�6�"&�D����/1�0rc���|j}|�,|�|���n|�|��|j���s7|�|j�d��n|j�|��t
���|��d|_d|_	d|_
d|_dSr)rw�feed_eofrSrsrLrMrgrVrjrnrorp)rDrUr%rus   �rrVz$StreamReaderProtocol.connection_lost
s�����$�����{����!�!�!�!��$�$�S�)�)�)��|� � �"�"�	0��{���'�'��-�-�-�-���*�*�3�/�/�/�
������$�$�$�!%���"�����
�����rc�F�|j}|�|�|��dSdSr)rw�	feed_data)rD�datar%s   r�
data_receivedz"StreamReaderProtocol.data_receiveds2���$�������T�"�"�"�"�"��rc�R�|j}|�|���|jrdSdS)NFT)rwr�rr)rDr%s  r�eof_receivedz!StreamReaderProtocol.eof_received!s6���$�����O�O�����>�	��5��trc��|jSr)rsr_s  rraz&StreamReaderProtocol._get_close_waiter,s
���|�rc��	|j}|���r*|���s|���dSdSdS#t$rYdSwxYwr)rsrLr�r��AttributeError)rD�closeds  r�__del__zStreamReaderProtocol.__del__/s���	#��\�F��{�{�}�}�
#�V�%5�%5�%7�%7�
#�� � �"�"�"�"�"�
#�
#�
#�
#���	�	�	��D�D�	���s�A�
A�A�NN)rbrcrdrkrE�propertyrwr{r�rVr�r�rar��
__classcell__)rus@rrr�s�����������2�2�2�2�2�2�(�(�(��X�(�
L�L�L�('�('�('�T�����$#�#�#�
	�	�	����	#�	#�	#�	#�	#�	#�	#rrc�~�eZdZ	d�Zd�Zed���Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
dd�Zd
�Zddd�d�Zd�ZdS)rc��||_||_||_||_|j���|_|j�d��dSr)rp�	_protocol�_readerr>rY�
_complete_futrM)rDr&rr%rs     rrEzStreamWriter.__init__EsS��#���!��������
�!�Z�5�5�7�7�����%�%�d�+�+�+�+�+rc���|jjd|j��g}|j�|�d|j����d�d�|����S)N�
transport=zreader=�<{}>� )rurbrpr�rZ�format�join�rD�infos  r�__repr__zStreamWriter.__repr__Os]����'�)I�d�o�)I�)I�J���<�#��K�K�2�$�,�2�2�3�3�3��}�}�S�X�X�d�^�^�,�,�,rc��|jSr�rprIs rr&zStreamWriter.transportUs
����rc�:�|j�|��dSr)rp�write�rDr�s  rr�zStreamWriter.writeYs������d�#�#�#�#�#rc�:�|j�|��dSr)rp�
writelinesr�s  rr�zStreamWriter.writelines\s����"�"�4�(�(�(�(�(rc�4�|j���Sr)rp�	write_eofrIs rr�zStreamWriter.write_eof_s����(�(�*�*�*rc�4�|j���Sr)rp�
can_write_eofrIs rr�zStreamWriter.can_write_eofbs����,�,�.�.�.rc�4�|j���Sr)rpr�rIs rr�zStreamWriter.closees����$�$�&�&�&rc�4�|j���Sr)rp�
is_closingrIs rr�zStreamWriter.is_closinghs����)�)�+�+�+rc��JK�|j�|���d{V��dSr)r�rarIs r�wait_closedzStreamWriter.wait_closedks4�����n�.�.�t�4�4�4�4�4�4�4�4�4�4�4rNc�8�|j�||��Sr)rprz)rD�name�defaults   rrzzStreamWriter.get_extra_infons����-�-�d�G�<�<�<rc���K�	|j�|j���}|�|�|j���rt	d���d{V��|j����d{V��dS)Nr)r�r�rpr�rr�r\)rDrUs  r�drainzStreamWriter.drainqs�����	��<�#��,�(�(�*�*�C����	��?�%�%�'�'�
	���(�(�N�N�N�N�N�N�N��n�*�*�,�,�,�,�,�,�,�,�,�,�,r)�server_hostname�ssl_handshake_timeoutc��K�	|jjdu}|j}|����d{V��|j�|j|||||����d{V��}||_|�|��dS)N)�server_sider�r�)r�rqr�r>�	start_tlsrpr{)rDryr�r�r�r�
new_transports       rr�zStreamWriter.start_tls�s�����	B��n�9��E���>���j�j�l�l��������"�j�2�2��O�X�z�#�_�"7�3�9�9�9�9�9�9�9�9�
�(���� � ��&�&�&�&�&rc��|j���sh|j���rt	jdt��dS|���t	jd|��t��dSdS)Nzloop is closedz	unclosed )rpr�r>�	is_closed�warnings�warn�ResourceWarningr�rIs rr�zStreamWriter.__del__�s�����)�)�+�+�	E��z�#�#�%�%�
E��
�.��@�@�@�@�@��
�
�����
�2�$�2�2�O�D�D�D�D�D�	E�	Err)rbrcrdrEr�r�r&r�r�r�r�r�r�r�rzr�r�r�rrrrr;s�������,�,�,�-�-�-�����X��$�$�$�)�)�)�+�+�+�/�/�/�'�'�'�,�,�,�5�5�5�=�=�=�=�-�-�-�4)-�.2�'�'�'�'�'�E�E�E�E�Errc��eZdZdZedfd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zdd�Zdd�Zd�Zd�Zd�ZdS)rNc�z�|dkrtd���||_|�tj��|_n||_t��|_d|_d|_d|_	d|_
d|_|j���r-tjtjd����|_dSdS)NrzLimit cannot be <= 0Fr)�
ValueError�_limitr
r=r>�	bytearray�_buffer�_eof�_waiter�
_exceptionrpr?rGr�
extract_stack�sys�	_getframerk)rDrrs   rrEzStreamReader.__init__�s����A�:�:��3�4�4�4�����<��/�1�1�D�J�J��D�J� �{�{�����	��������������:���!�!�	"�%3�%A��
�a� � �&"�&"�D�"�"�"�	"�	"rc�\�dg}|jr*|�t|j���d���|jr|�d��|jt
kr|�d|j����|jr|�d|j����|jr|�d|j����|jr|�d|j����|j	r|�d��d	�
d
�|����S)Nrz bytes�eofzlimit=zwaiter=z
exception=r��pausedr�r�)r�rZ�lenr�r��_DEFAULT_LIMITr�r�rpr?r�r�r�s  rr�zStreamReader.__repr__�s,������<�	6��K�K�3�t�|�,�,�4�4�4�5�5�5��9�	��K�K������;�.�(�(��K�K�.���.�.�/�/�/��<�	4��K�K�2�$�,�2�2�3�3�3��?�	:��K�K�8�T�_�8�8�9�9�9��?�	:��K�K�8�T�_�8�8�9�9�9��<�	"��K�K��!�!�!��}�}�S�X�X�d�^�^�,�,�,rc��|jSr)r�rIs rr�zStreamReader.exception�s
����rc��||_|j}|�2d|_|���s|�|��dSdSdSr)r�r�r�rSrTs   rrSzStreamReader.set_exception�s]�����������D�L��#�#�%�%�
*��$�$�S�)�)�)�)�)���
*�
*rc��	|j}|�2d|_|���s|�d��dSdSdSr)r�r�rMrNs  r�_wakeup_waiterzStreamReader._wakeup_waiter�sY��?�������D�L��#�#�%�%�
(��!�!�$�'�'�'�'�'���
(�
(rc��||_dSrr�)rDr&s  rr�zStreamReader.set_transport�s
��#����rc��|jr?t|j��|jkr$d|_|j���dSdSdS)NF)r?r�r�r�rp�resume_readingrIs r�_maybe_resume_transportz$StreamReader._maybe_resume_transport�sS���<�	-�C���-�-���<�<� �D�L��O�*�*�,�,�,�,�,�	-�	-�<�<rc�<�d|_|���dSrR)r�r�rIs rr�zStreamReader.feed_eof�s!����	��������rc�"�	|jo|jSr)r�r�rIs r�at_eofzStreamReader.at_eof�s��K��y�-���-�-rc�D�|sdS|j�|��|���|j�b|js]t|j��d|jzkr?	|j���d|_dS#t$rd|_YdSwxYwdSdSdS)N�T)	r��extendr�rpr?r�r��
pause_readingr^r�s  rr�zStreamReader.feed_data�s����	��F�����D�!�!�!��������O�'��L�
(��D�L�!�!�A���O�3�3�
$���-�-�/�/�/� $������
'�
'�
'�
'�#'������	
'����
(�'�'�'�3�3s�"B�B�Bc��
K�	|j�t|�d����|jr d|_|j���|j���|_	|j�d{V��d|_dS#d|_wxYw)NzF() called while another coroutine is already waiting for incoming dataF)r��RuntimeErrorr?rpr�r>rY)rD�	func_names  r�_wait_for_datazStreamReader._wait_for_datas�����	��<�#���5�5�5�6�6�
6��<�	-� �D�L��O�*�*�,�,�,��z�/�/�1�1���	 ��,���������D�L�L�L��4�D�L����s�#
A9�9	Bc���K�	d}t|��}	|�|���d{V��}n�#tj$r}|jcYd}~Sd}~wtj$r}|j�||j��r|jd|j|z�=n|j�	��|�
��t|jd���d}~wwxYw|S)N�
r)
r��	readuntilr�IncompleteReadError�partial�LimitOverrunErrorr��
startswith�consumed�clearr�r��args)rD�sep�seplen�line�es     r�readlinezStreamReader.readline#s����	����S����
	(�����,�,�,�,�,�,�,�,�D�D���-�	�	�	��9������������+�	(�	(�	(��|�&�&�s�A�J�7�7�
%��L�!5�!�*�v�"5�!5�6�6���"�"�$�$�$��(�(�*�*�*��Q�V�A�Y�'�'�'�����
	(�����s(�2�C�A
�C�
C�A:C�Cr�c���K�	t|��}|dkrtd���|j�|j�d}	t|j��}||z
|krJ|j�||��}|dkrn�|dz|z
}||jkrt
jd|���|jrBt|j��}|j�
��t
j|d���|�d���d{V����||jkrt
jd|���|jd||z�}|jd||z�=|�
��t|��S)	Nrz,Separator should be at least one-byte stringT���rz2Separator is not found, and chunk exceed the limitr�z2Separator is found, but chunk is longer than limit)r�r�r�r��findr�rr�r��bytesr�r�r�r�)rD�	separatorr��offset�buflen�isep�chunks       rr�zStreamReader.readuntilBs�����	�&�Y�����Q�;�;��K�L�L�L��?�&��/�!�*��	3����&�&�F����&�(�(��|�(�(��F�;�;���2�:�:�� �!��f�,���D�K�'�'�$�6�L�� � � ��y�
B��d�l�+�+����"�"�$�$�$� �4�U�D�A�A�A��%�%�k�2�2�2�2�2�2�2�2�2�=	3�@�$�+����.�D�d�L�L�
L���^�d�V�m�^�,���L��$��-��(��$�$�&�&�&��U�|�|�rrc��K�	|j�|j�|dkrdS|dkrQg}	|�|j���d{V��}|sn|�|���9d�|��S|js"|js|�d���d{V��t|jd|���}|jd|�=|�	��|S)NrrT�read)
r�r	r�rZr�r�r�r�rr�)rD�n�blocks�blockr�s     rr	zStreamReader.read�s����	�*�?�&��/�!���6�6��3��q�5�5�
�F�
%�"�i�i���4�4�4�4�4�4�4�4������
�
�e�$�$�$�	
%�
�8�8�F�#�#�#��|�	.�D�I�	.��%�%�f�-�-�-�-�-�-�-�-�-��T�\�"�1�"�%�&�&���L��!����$�$�&�&�&��rc��K�	|dkrtd���|j�|j�|dkrdSt|j��|kr||jrBt|j��}|j���tj||���|�	d���d{V��t|j��|k�|t|j��|kr.t|j��}|j���n&t|jd|���}|jd|�=|�
��|S)Nrz*readexactly size can not be less than zeror�readexactly)r�r�r�r�r�rr�rr�r�r�)rDr
�
incompleter�s    rrzStreamReader.readexactly�sP����
	�
�q�5�5��I�J�J�J��?�&��/�!���6�6��3��$�,���!�#�#��y�
D�"�4�<�0�0�
���"�"�$�$�$� �4�Z��C�C�C��%�%�m�4�4�4�4�4�4�4�4�4�
�$�,���!�#�#��t�|����!�!����&�&�D��L��� � � � ����b�q�b�)�*�*�D���R�a�R� ��$�$�&�&�&��rc��|SrrrIs r�	__aiter__zStreamReader.__aiter__�s���rc��XK�|����d{V��}|dkrt�|S)Nr)r��StopAsyncIteration)rD�vals  r�	__anext__zStreamReader.__anext__�s9�����M�M�O�O�#�#�#�#�#�#���#�:�:�$�$��
r)r�)r)rbrcrdrkr�rEr�r�rSr�r�r�r�r�r�r�r�r�r	rrrrrrrr�s4��������+�$�"�"�"�"�,-�-�-�$���*�*�*�(�(�(�$�$�$�-�-�-�
���.�.�.�$�$�$�, � � �8���>Y�Y�Y�Y�v1�1�1�1�f'�'�'�R�������rrr�r)�__all__r@�socketr�r�rh�hasattr�rr
rrr�logr�tasksrr�rrr	r
�Protocolr9rrrrrr�<module>rsf��'������
�
�
�
�
�
�
�
���������
�7�6�9���=��<�<�G���������������������������������������������� .������8A�+�A�A�A�A�A�B�7�6�9���D�
�)7�
�
�
�
�
�D�&4�D�D�D�D�D�="�="�="�="�="�y�)�="�="�="�@D#�D#�D#�D#�D#�+�Y�-?�D#�D#�D#�NcE�cE�cE�cE�cE�cE�cE�cE�J`�`�`�`�`�`�`�`�`�`r

?>