HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/asyncio/__pycache__/streams.cpython-310.opt-2.pyc
o

�i�d�@s&dZddlZddlZddlZddlZddlZeed�red7ZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddl
mZddlmZd
Zded�dd�Zded�dd�Zeed�rpd ed�dd�Zd ed�dd�ZGdd�dej�ZGdd�deej�ZGdd�d�ZGdd�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	�sb�	t��}t||d�}t||d��|j�fdd�||fi|��IdH\}}t|�||�}||fS)N�r�loop�rc��S�N�r��protocolr�,/usr/local/lib/python3.10/asyncio/streams.py�<lambda>1�z!open_connection.<locals>.<lambda>)r�get_running_looprr�create_connectionr)	�host�portr�kwdsr�reader�	transport�_�writerrrrrs���rc�s8�	t������fdd�}�j|||fi|��IdHS)Nc�t��d�}t|��d�}|S�Nrr�rr�r#r��client_connected_cbrrrr�factoryO�
�zstart_server.<locals>.factory)rr�
create_server)r,r r!rr"r-rr+rr6s
�rc�s`�	t��}t||d�}t||d��|j�fdd�|fi|��IdH\}}t|�||�}||fS)Nrrcrrrrrrrrcrz&open_unix_connection.<locals>.<lambda>)rrrrZcreate_unix_connectionr)�pathrr"rr#r$r%r&rrrr[s���rc�s6�	t������fdd�}�j||fi|��IdHS)Ncr'r(r)r*r+rrr-lr.z"start_unix_server.<locals>.factory)rrZcreate_unix_server)r,r0rr"r-rr+rr	gs
�r	c@s@eZdZ	ddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�FlowControlMixinNcCs8|durtjdd�|_n||_d|_t��|_d|_dS)N�)�
stacklevelF)r�_get_event_loop�_loop�_paused�collections�deque�_drain_waiters�_connection_lost)�selfrrrr�__init__s

zFlowControlMixin.__init__cCs$d|_|j��rt�d|�dSdS)NTz%r pauses writing)r6r5�	get_debugr�debug�r;rrr�
pause_writing�s
�zFlowControlMixin.pause_writingcCs>d|_|j��rt�d|�|jD]}|��s|�d�qdS)NFz%r resumes writing)r6r5r=rr>r9�done�
set_result�r;�waiterrrr�resume_writing�s


��zFlowControlMixin.resume_writingcCsFd|_|jsdS|jD]}|��s |dur|�d�q|�|�qdS�NT)r:r6r9rArB�
set_exception�r;�excrDrrr�connection_lost�s

��z FlowControlMixin.connection_lostc	�s\�|jrtd��|js
dS|j��}|j�|�z|IdHW|j�|�dS|j�|�w)NzConnection lost)r:�ConnectionResetErrorr6r5�
create_futurer9�append�removerCrrr�
_drain_helper�s�
zFlowControlMixin._drain_helpercCst�r)�NotImplementedError�r;�streamrrr�_get_close_waiter��z"FlowControlMixin._get_close_waiterr)	�__name__�
__module__�__qualname__r<r@rErJrOrSrrrrr1us
		

r1csdeZdZ	dZd�fdd�	Zedd��Zdd�Z�fdd	�Zd
d�Z	dd
�Z
dd�Zdd�Z�Z
S)rNcstt�j|d�|durt�|�|_|j|_nd|_|dur ||_d|_d|_d|_	d|_
||_d|_|j
��|_dS)NrF)�superr<�weakref�ref�_stream_reader_wr�_source_traceback�_strong_reader�_reject_connection�_stream_writer�_task�
_transport�_client_connected_cb�	_over_sslr5rL�_closed)r;Z
stream_readerr,r��	__class__rrr<�s
zStreamReaderProtocol.__init__cCs|jdurdS|��Sr)r[r?rrr�_stream_reader�s
z#StreamReaderProtocol._stream_readercCs�|jrddi}|jr|j|d<|j�|�|��dS||_|j}|dur*|�|�|�d�du|_	|j
durXt||||j�|_|�
||j�}t
�|�rS|j�|�|_d|_dSdS)N�messagezpAn open stream was garbage collected prior to establishing network connection; call "stream.close()" explicitly.Zsource_tracebackZ
sslcontext)r^r\r5Zcall_exception_handler�abortrarg�
set_transport�get_extra_inforcrbrr_rZiscoroutineZcreate_taskr`r])r;r$�contextr#�resrrr�connection_made�s2�


��

�z$StreamReaderProtocol.connection_madecs~|j}|dur|dur|��n|�|�|j��s+|dur%|j�d�n|j�|�t��|�d|_d|_	d|_
d|_dSr)rg�feed_eofrGrdrArBrXrJr[r_r`ra)r;rIr#rerrrJ�s



z$StreamReaderProtocol.connection_lostcCs |j}|dur|�|�dSdSr)rg�	feed_data)r;�datar#rrr�
data_receiveds�z"StreamReaderProtocol.data_receivedcCs$|j}|dur|��|jrdSdS)NFT)rgrorc)r;r#rrr�eof_receivedsz!StreamReaderProtocol.eof_receivedcC�|jSr)rdrQrrrrS�z&StreamReaderProtocol._get_close_waitercCsDz|j}Wn
tyYdSw|��r|��s |��dSdSdSr)rd�AttributeErrorrA�	cancelled�	exception)r;�closedrrr�__del__s
��zStreamReaderProtocol.__del__�NN)rUrVrWr\r<�propertyrgrnrJrrrsrSrz�
__classcell__rrrerr�s
rc@steZdZ	dd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�Zdd�ZdS)rcCs4||_||_||_||_|j��|_|j�d�dSr)ra�	_protocol�_readerr5rLZ
_complete_futrB)r;r$rr#rrrrr<0szStreamWriter.__init__cCs@|jjd|j��g}|jdur|�d|j���d�d�|��S)N�
transport=zreader=�<{}>� )rfrUrarrM�format�join�r;�inforrr�__repr__:s
zStreamWriter.__repr__cCrtr�rar?rrrr$@szStreamWriter.transportcC�|j�|�dSr)ra�write�r;rqrrrr�D�zStreamWriter.writecCr�r)ra�
writelinesr�rrrr�Gr�zStreamWriter.writelinescC�
|j��Sr)ra�	write_eofr?rrrr�J�
zStreamWriter.write_eofcCr�r)ra�
can_write_eofr?rrrr�Mr�zStreamWriter.can_write_eofcCr�r)ra�closer?rrrr�Pr�zStreamWriter.closecCr�r)ra�
is_closingr?rrrr�Sr�zStreamWriter.is_closingc�s�|j�|�IdHdSr)r~rSr?rrr�wait_closedVs�zStreamWriter.wait_closedNcCs|j�||�Sr)rark)r;�name�defaultrrrrkYszStreamWriter.get_extra_infoc�sP�	|jdur|j��}|dur|�|j��rtd�IdH|j��IdHdS)Nr)rrxrar�rr~rO)r;rIrrr�drain\s�



zStreamWriter.drainr)rUrVrWr<r�r|r$r�r�r�r�r�r�r�rkr�rrrrr&s	


rc@s�eZdZdZedfdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd&dd�Zd'dd�Zd d!�Zd"d#�Zd$d%�ZdS)(rNcCsz|dkrtd��||_|durt��|_n||_t�|_d|_d|_d|_	d|_
d|_|j��r;t
�t�d��|_dSdS)NrzLimit cannot be <= 0Fr
)�
ValueError�_limitrr4r5�	bytearray�_buffer�_eof�_waiter�
_exceptionrar6r=r�
extract_stack�sys�	_getframer\)r;rrrrrr<zs"

��zStreamReader.__init__cCs�dg}|jr|�t|j��d��|jr|�d�|jtkr'|�d|j���|jr3|�d|j���|jr?|�d|j���|jrK|�d|j���|j	rS|�d�d	�
d
�|��S)Nrz bytes�eofzlimit=zwaiter=z
exception=r�Zpausedr�r�)r�rM�lenr�r��_DEFAULT_LIMITr�r�rar6r�r�r�rrrr��s 


zStreamReader.__repr__cCrtr)r�r?rrrrx�ruzStreamReader.exceptioncCs8||_|j}|durd|_|��s|�|�dSdSdSr)r�r�rwrGrHrrrrG�s�zStreamReader.set_exceptioncCs4	|j}|durd|_|��s|�d�dSdSdSr)r�rwrBrCrrr�_wakeup_waiter�s�zStreamReader._wakeup_waitercCs
||_dSrr�)r;r$rrrrj�s
zStreamReader.set_transportcCs2|jrt|j�|jkrd|_|j��dSdSdS)NF)r6r�r�r�ra�resume_readingr?rrr�_maybe_resume_transport�s�z$StreamReader._maybe_resume_transportcCsd|_|��dSrF)r�r�r?rrrro�szStreamReader.feed_eofcCs	|jo|jSr)r�r�r?rrr�at_eof�szStreamReader.at_eofcCs�|sdS|j�|�|��|jdur:|js<t|j�d|jkr>z|j��Wn
ty4d|_YdSwd|_dSdSdSdS)N�T)	r��extendr�rar6r�r�Z
pause_readingrPr�rrrrp�s 
��
�zStreamReader.feed_datac�s`�	|jdurt|�d���|jrd|_|j��|j��|_z|jIdHWd|_dSd|_w)NzF() called while another coroutine is already waiting for incoming dataF)r��RuntimeErrorr6rar�r5rL)r;�	func_namerrr�_wait_for_data�s�
�
zStreamReader._wait_for_datac
�s��	d}t|�}z|�|�IdH}W|Stjy)}z	|jWYd}~Sd}~wtjyW}z"|j�||j�rC|jd|j|�=n|j�	�|�
�t|jd��d}~ww)N�
r)
r��	readuntilr
�IncompleteReadError�partial�LimitOverrunErrorr��
startswith�consumed�clearr�r��args)r;�sep�seplen�line�errr�readline�s$�
��
��zStreamReader.readliner�c�s�	t|�}|dkrtd��|jdur|j�d}	t|j�}|||krA|j�||�}|dkr0n-|d|}||jkrAt�d|��|jrTt	|j�}|j�
�t�|d��|�d�IdHq||jkrht�d|��|jd||�}|jd||�=|�
�t	|�S)	Nrz,Separator should be at least one-byte stringT���r
z2Separator is not found, and chunk exceed the limitr�z2Separator is found, but chunk is longer than limit)r�r�r�r��findr�r
r�r��bytesr�r�r�r�)r;�	separatorr��offset�buflenZisep�chunkrrrr�sD�


�

�
 �zStreamReader.readuntilr�c�s��	|jdur
|j�|dkrdS|dkr.g}	|�|j�IdH}|s#n|�|�qd�|�S|js<|js<|�d�IdHt|jd|��}|jd|�=|�	�|S)Nr�T�read)
r�r�r�rMr�r�r�r�r�r�)r;�nZblocks�blockrqrrrr�ss*�

�
zStreamReader.readc�s��	|dkr
td��|jdur|j�|dkrdSt|j�|krA|jr2t|j�}|j��t�||��|�	d�IdHt|j�|kst|j�|krSt|j�}|j��nt|jd|��}|jd|�=|�
�|S)Nrz*readexactly size can not be less than zeror��readexactly)r�r�r�r�r�r�r�r
r�r�r�)r;r�Z
incompleterqrrrr��s,�


�
zStreamReader.readexactlycCs|Srrr?rrr�	__aiter__�rTzStreamReader.__aiter__c�s �|��IdH}|dkrt�|S)Nr�)r��StopAsyncIteration)r;�valrrr�	__anext__�s
�zStreamReader.__anext__)r�)r�)rUrVrWr\r�r<r�rxrGr�rjr�ror�rpr�r�r�r�r�r�r�rrrrrvs&	

[3)rr{r)�__all__r7�socketr��warningsrY�hasattr�rrr
rr�logrZtasksrr�rrrr	ZProtocolr1rrrrrrr�<module>sB
��
"��@qP