MOON
Server: Apache
System: Linux server30c.hostingraja.org 3.10.0-962.3.2.lve1.5.63.el7.x86_64 #1 SMP Fri Oct 8 12:03:35 UTC 2021 x86_64
User: jibhires (1887)
PHP: 8.1.30
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open, allow_url_fopen, symlink, escapeshellcmd, pcntl_exec
Upload Files
File: //opt/alt/python35/lib64/python3.5/site-packages/aiohttp/__pycache__/client_proto.cpython-35.pyc


���Z��@s�ddlZddlZddlmZddlmZmZmZddlm	Z	ddl
mZmZGdd�deej
j
�ZdS)	�N)�suppress�)�
ClientOSError�ClientPayloadError�ServerDisconnectedError)�HttpResponseParser)�
EMPTY_PAYLOAD�	DataQueuec
s�eZdZdZdddd�Zedd��Zedd	��Zd
d�Zdd
�Z	dd�Z
�fdd�Zdd�Zdd�Z
dd�Z�fdd�Zdd�Zddddddd d!d"d#�Zd$d%�Z�S)&�ResponseHandlerz8Helper class to adapt between Protocol and StreamReader.�loopNcCs�tjjj|d|�tj|d|�d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_dS)NrF�)�asyncio�streams�FlowControlMixin�__init__r	�	transport�
_should_close�_message�_payload�
_skip_payload�_payload_parser�_reading_pausedZ_timer�_tail�	_upgraded�_parser)�selfr�r�/client_proto.pyrs										zResponseHandler.__init__cCs|jS)N)r)rrrr�upgraded!szResponseHandler.upgradedcCsr|jdk	r|jj�s(|jr,dS|jpq|jpq|j�dk	pq|jdk	pqt|�pq|jS)NT)r�is_eofrr�	exceptionr�lenr)rrrr�should_close%szResponseHandler.should_closecCs5|j}|dk	r1|j�d|_d|_|S)N)r�closer)rrrrrr#0s	
		zResponseHandler.closecCs
|jdk	S)N)r)rrrr�is_connected8szResponseHandler.is_connectedcCs
||_dS)N)r)rrrrr�connection_made;szResponseHandler.connection_madecs%|jdk	r0tt��|jj�WdQRXy|jj�}Wn=tk
r�d}|jdk	r~|jjtd��YnX|j�s�t	|t
�r�t|j�}|dkr�t
|�}|j|�d|_d|_d|_d|_d|_d|_d|_t�j|�dS)Nz!Response payload is not completedTF)rr�	ExceptionZfeed_eofrr�
set_exceptionrr�
isinstance�OSErrorr�argsrrrrr�super�connection_lost)r�excZuncompleted)�	__class__rrr,>s0

	
							zResponseHandler.connection_lostcCsdS)Nr)rrrr�eof_received^szResponseHandler.eof_receivedc
CsE|jsAy|jj�Wntttfk
r7YnXd|_dS)NT)rr�
pause_reading�AttributeError�NotImplementedError�RuntimeError)rrrrr0as	zResponseHandler.pause_readingc
CsE|jrAy|jj�Wntttfk
r7YnXd|_dS)NF)rr�resume_readingr1r2r3)rrrrr4is	zResponseHandler.resume_readingcsd|_t�j|�dS)NT)rr+r')rr-)r.rrr'qs	zResponseHandler.set_exceptioncCs?||_||_|jr;|jd}|_|j|�dS)Nr)rrr�
data_received)r�parser�payload�datarrr�
set_parserus
			zResponseHandler.set_parser�timer�skip_payloadF�read_until_eof�auto_decompressTcCsc||_t||jd|dtd|d|�|_|jr_|jd}|_|j|�dS)Nr:Zpayload_exceptionr<r=r)rrZ_looprrrr5)rr:r;r<r=r8rrr�set_response_params}s		z#ResponseHandler.set_response_paramsc	Cs�|s
dS|jdk	r`|jj|�\}}|r\d|_d|_|r\|j|�dS|jsx|jdkr�|j|7_ny|jj|�\}}}WnCtk
r�}z#|jj	�|j
|�dSWYdd}~XnX||_x|D]w\}}|jrd|_||_
||_|jsG|jdkr`|j|tfd�q�|j||fd�q�W|r�|r�|j|�n	||_dS)NT���0r)r?r@)rZ	feed_datarr5rrr�
BaseExceptionrr#r'r"rrr�coder)	rr8�eof�tailZmessagesrr-�messager7rrrr5�s>		


					zResponseHandler.data_received)�__name__�
__module__�__qualname__�__doc__r�propertyrr"r#r$r%r,r/r0r4r'r9r>r5rr)r.rr
s$ 	r
)r
Zasyncio.streams�
contextlibrZclient_exceptionsrrrZhttprrrr	rr
rrrr�<module>s