403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.137.184.32
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/web_protocol.cpython-38.pyc
U

'�7`�Z�
@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z
ddlmZddl
mZddlmZmZmZmZmZmZmZmZddlZdd	lmZmZdd
lmZddlmZm Z ddlm!Z!m"Z"m#Z#m$Z$m%Z%dd
l&m'Z'm(Z(ddl)m*Z*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5m6Z6dZ7e�rJddl8m9Z9ee$e+dedge3fZ:ee3gee6fZ;e$dde#iidddde�<d��
Z=Gdd�de>�Z?Gdd�de>�Z@Gd d�de�ZAdS)!�N)�deque)�suppress)�escape)�
HTTPStatus)�Logger)�
TYPE_CHECKING�Any�	Awaitable�Callable�Optional�Tuple�Type�cast�)�AbstractAccessLogger�AbstractStreamWriter)�BaseProtocol)�CeilTimeout�current_task)�HttpProcessingError�HttpRequestParser�
HttpVersion10�RawRequestMessage�StreamWriter)�
access_logger�
server_logger)�
EMPTY_PAYLOAD�StreamReader)�
tcp_keepalive)�
HTTPException)�AccessLogger)�BaseRequest)�Response�StreamResponse)�RequestHandler�RequestPayloadError�PayloadAccessError)�Serverr$zasyncio.Task[None]�UNKNOWN�/TFc@seZdZdZdS)r%zPayload parsing error.N��__name__�
__module__�__qualname__�__doc__�r/r/�G/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/web_protocol.pyr%9sr%c@seZdZdZdS)r&z-Payload was accessed after response was sent.Nr*r/r/r/r0r&=sr&cs�eZdZdZdZdZddeeeej	ddddd	d
d�de
jee
eeeeee
eeeeed
��fdd�Zed�dd�Zeed�dd��ZdHeedd�dd�Ze
jdd��fdd�Zeedd��fdd�Zedd �d!d"�Zdd�d#d$�Ze dd%�d&d'�Z!e
dd(�d)d*�Z"dd�d+d,�Z#dd�d-d.�Z$e%e&edd/�d0d1�Z'eedd2�d3d4�Z(eedd2�d5d6�Z)dd�d7d8�Z*e%ee+e&e
fd9�d:d;�Z,dd�d<d=�Z-e%e&ee
d>�d?d@�Z.dIe%eeeeee&dB�dCdD�Z/dJe0eeeeeddE�dFdG�Z1�Z2S)Kr$a�HTTP protocol implementation.

    RequestHandler handles incoming HTTP request. It reads request line,
    request headers and request payload and calls handle_request() method.
    By default it always returns with 404 response.

    RequestHandler handles errors in incoming request, like bad
    status line, bad headers or incomplete payload. If any error occurs,
    connection gets closed.

    :param keepalive_timeout: number of seconds before closing
                              keep-alive connection
    :type keepalive_timeout: int or None

    :param bool tcp_keepalive: TCP keep-alive is on, default is on

    :param bool debug: enable debug mode

    :param logger: custom logger object
    :type logger: aiohttp.log.server_logger

    :param access_log_class: custom class for access_logger
    :type access_log_class: aiohttp.abc.AbstractAccessLogger

    :param access_log: custom logging object
    :type access_log: aiohttp.log.server_logger

    :param str access_log_format: access log format string

    :param loop: Optional event loop

    :param int max_line_size: Optional maximum header line size

    :param int max_field_size: Optional maximum header field size

    :param int max_headers: Optional maximum header size

    r)�_request_count�
_keepalive�_manager�_request_handler�_request_factory�_tcp_keepalive�_keepalive_time�_keepalive_handle�_keepalive_timeout�_lingering_time�	_messages�
_message_tail�_waiter�_error_handler�
_task_handler�_upgrade�_payload_parser�_request_parserZ_reading_paused�logger�debug�
access_logr�_close�_force_close�_current_requestg�R@TFi�i�g$@i)�keepalive_timeoutrrC�access_log_classrE�access_log_formatrD�
max_line_size�max_headers�max_field_size�lingering_time�read_bufsizer')�manager�looprIrrCrJrErKrDrLrMrNrOrPc
	s�t��|�d|_d|_d|_||_|j|_|j|_	||_
d|_d|_||_
t|
�|_t�|_d|_d|_d|_d|_d|_d|_t||||
||td�|_||_|	|_||_|r�|||�|_nd|_d|_d|_ dS)NrFg�)rLrNrMZpayload_exception)!�super�__init__r1r2rHr3Zrequest_handlerr4Zrequest_factoryr5r6r7r8r9�floatr:rr;r<r=r>r?r@rArr%rBrCrDrErrFrG)�selfrQrRrIrrCrJrErKrDrLrMrNrOrP��	__class__r/r0rU�sR��
�
�zRequestHandler.__init__)�returncCsd�|jj|jdk	rdnd�S)Nz<{} {}>Z	connectedZdisconnected)�formatrYr+�	transport�rWr/r/r0�__repr__�s�zRequestHandler.__repr__cCs|jS�N)r9r]r/r/r0rI�sz RequestHandler.keepalive_timeout�.@N)�timeoutrZc
�s�d|_|jdk	r|j��|jr*|j��ttjtj��zt||j	d��`|j
dk	rj|j
��sj|j
IdH|jdk	r�|j�
t���|jdk	r�|j��s�|jIdHW5QRXW5QRX|jdk	r�|j��|jdk	r�|j��d|_dS)z�Worker process is about to exit, we need cleanup everything and
        stop accepting requests. It is especially important for keep-alive
        connections.TN�rR)rGr8�cancelr=r�asyncio�CancelledError�TimeoutErrorr�_loopr>�donerH�_cancelr?r\�close)rWrar/r/r0�shutdown�s$



 



zRequestHandler.shutdown)r\rZcsXt��|�ttj|�}|jr&t|�|j�|�	��|_
|jdk	sFt�|j�||�dSr_)
rT�connection_maderrdZ	Transportr6rrg�create_task�startr?r3�AssertionError)rWr\Zreal_transportrXr/r0rl�szRequestHandler.connection_made)�excrZcs�|jdkrdS|j�||�t��|�d|_d|_d|_d|_d|_|jdk	rZ|j��|j	dk	r�|dkrtt
d�}|j	�|�|jdk	r�|j��|j
dk	r�|j
��|jdk	r�|j��d|_
|jdk	r�|j��d|_dS)NTzConnection lost)r3�connection_lostrTrGr5r4rBr8rcrH�ConnectionResetErrorrir>r?r=rAZfeed_eof)rWrprXr/r0rqs2











zRequestHandler.connection_lost)�parserrZcCs2|jdkst�||_|jr.|j�|j�d|_dS)NrS)rAror<�	feed_data)rWrsr/r/r0�
set_parser&s
zRequestHandler.set_parsercCsdSr_r/r]r/r/r0�eof_received0szRequestHandler.eof_received)�datarZc
Cs�|js|jrdS|jdk�rP|j�sP|jdk	s2t�z|j�|�\}}}Wn�tk
r�}z0|j�	|�
t||j�d||j��|_
|��W5d}~XYn�tk
r�}z,|j�	|�
t||j�d|��|_
|��W5d}~XYnpX|�r6|D]&\}}|jd7_|j�||f�q�|j}|dk	�r6|���s6|�d�||_|�r�|�r�||_nN|jdk�rz|j�rz|�rz|j|7_n$|�r�|j�|�\}	}|	�r�|��dS)Ni���r)rGrFrAr@rBrortrrgrm�handle_parse_errorr�messager>rj�	Exceptionr1r;�appendr=rh�
set_resultr<)
rWrw�messagesZupgraded�tailrp�msg�payload�waiter�eofr/r/r0�
data_received3sL
���


zRequestHandler.data_received)�valrZcCs ||_|jr|j��d|_dS)zMSet keep-alive connection mode.

        :param bool val: new state.
        N)r2r8rc)rWr�r/r/r0�
keep_aliveds
zRequestHandler.keep_alivecCsd|_|jr|j��dS)ziStop accepting new pipelinig messages and close
        connection when handlers done processing messagesTN)rFr=rcr]r/r/r0rjnszRequestHandler.closecCs4d|_|jr|j��|jdk	r0|j��d|_dS)zForce close connectionTN)rGr=rcr\rjr]r/r/r0�force_closeus


zRequestHandler.force_close)�request�response�timerZcCs(|jdk	r$|j�|||j��|�dSr_)r�logrgr�)rWr�r�r�r/r/r0�
log_access~s
zRequestHandler.log_access)�args�kwrZcOs|jr|jj||�dSr_)rDrC�rWr�r�r/r/r0�	log_debug�szRequestHandler.log_debugcOs|jj||�dSr_)rC�	exceptionr�r/r/r0�
log_exception�szRequestHandler.log_exceptioncCsT|js|jsdS|j|j}|jr<|j��|kr<|��dS|j�|j	|j
�|_dSr_)rGr2r7r9r=rgr�r�Z
call_later�KEEPALIVE_RESCHEDULE_DELAY�_process_keepaliver8)rW�nextr/r/r0r��s�z!RequestHandler._process_keepalive)r��
start_timerZc
�sL|jdk	st�z(z||_|�|�IdH}W5d|_XWn�tk
r�}z0t|j|j|j|jd�}|�	|||�IdH}W5d}~XYn�t
jk
r��Yn�t
jk
r�}z2|j
d|d�|�|d�}|�	|||�IdH}W5d}~XYnZtk
�r.}z&|�|d|�}|�	|||�IdH}W5d}~XYnX|�	|||�IdH}||fS)N)�status�reason�text�headerszRequest handler timed out.��exc_infoi�rx)r4rorHrr"r�r�r�r��finish_responserdrerfr��handle_errorr{)rWr�r��resprp�resetr/r/r0�_handle_request�s2�$$&zRequestHandler._handle_requestc�s�|j}|j}|dk	st�|j}|dk	s*t�|j}d}|jdk	sBt�|jdk	sPt�|j�s�|js�z@z|�
�|_	|j	IdHWn tjk
r�YW��q�YnXW5d|_	X|j�
�\}}|��}|jd7_t||�}	|�||||	|�}
d�z$�zv|j�|�|
|��}z|IdH\}}
Wn6tjtfk
�rN|�d�YWW����q�YnXt|dd��rjt�dt�~|
�r�|�d�WW����q�t |j!�|_|�"��sX|j#}|j�s4|�r4|�d	|�|��}||}t$tj%tj��P|�"��s*||k�r*t&|||d
��|�'�IdHW5QRX|��}�q�W5QRX|�"��sX|j�sX|�d�|�(�|�)t*��Wn�tjk
�r�|�d�YW���q�Ynzt+k
�r�}z"|j,�r�|j-d
|d�|�.�W5d}~XYn:t/k
�r}z|j-d|d�|�.�W5d}~XYnXW5|jdk�r4|dk	�r4|�d�n\|j�s�|j�r�|j�s�|dk	�r�|j��}||_|jdk�r�|�|||j�|_n��q�XqP|j�s�d|_|jdk	�r�|j0dk�r�|j�(�dS)a_Process incoming request.

        It reads request line, request headers and request payload, then
        calls handle_request() method. Subclass has to override
        handle_request(). start() handles various exceptions in request
        or response handling. Connection is being closed always unless
        keep_alive(True) specified.
        Nrz'Ignored premature client disconnection.z&Ignored premature client disconnectionZ__http_exception__Fzlreturning HTTPException object is deprecated (#2415) and will be removed, please raise the exception insteadz(Ignored premature client disconnection 2z'Start lingering close timer for %s sec.rbzUncompleted request.z'Ignored premature client disconnection zUnhandled runtime exceptionr�zUnhandled exception)1rgr?ror3r9r5r4rGr;r=Z
create_futurerdre�popleftr�Zrequests_countrr\r�r2rFr7r8Zcall_atr�rmr��ConnectionError�getattr�warnings�warn�DeprecationWarning�boolr�Zis_eofr:rrfrZreadanyrj�
set_exceptionr&�RuntimeErrorrDr�r�r{r>)rWrR�handlerrQrIr�rzr�rn�writerr��now�taskr�rOZend_trpr/r/r0rn�s�	



�

�



�zRequestHandler.start)r�r�r�rZc�s�|jdk	r6|j�d�d|_|jr6|j�|j�d|_z
|j}Wn4tk
rt|dkrbtd��ntd�|���YnXz ||�IdH|�	�IdHWn$t
k
r�|�|||�YdSX|�|||�dSdS)a
        Prepare the response and write_eof, then log access. This has to
        be called within the context of any exception so the access logger
        can get exception information. Returns True if the client disconnects
        prematurely.
        NFrSz+Missing return statement on request handlerz7Web-handler should return a response instance, got {!r}T)rBZset_upgradedr@r<rt�prepare�AttributeErrorr�r[�	write_eofr�r�)rWr�r�r�Zprepare_methr/r/r0r�4s0	


��
zRequestHandler.finish_responserx)r�r�rprzrZc
	Cs�|jd|d�d}|tjkr�d�tj�}tjj}d}|jrVtt��t�	�}W5QRXd|j
�dd�kr�|r�t|�}d	|�d
�}dj||d�}d}n|r�|}|d
|}t
|||d�}	|	��|jjdks�|jdkr�|��|	S)z�Handle errors.

        Returns HTTP response with specific status code. Logs additional
        information. It always closes current connection.zError handling requestr�z
text/plainz{0.value} {0.phrase}Nz	text/htmlZAccept�z<h2>Traceback:</h2>
<pre>z</pre>zV<html><head><title>{title}</title></head><body>
<h1>{title}</h1>
{msg}
</body></html>
)�titler�z

)r�r��content_typer)r�rZINTERNAL_SERVER_ERRORr[�descriptionrDrr{�	traceback�
format_excr��get�html_escaper"r�r�Zoutput_sizer\)
rWr�r�rprz�ctr�r��tbr�r/r/r0r�Xs6

��zRequestHandler.handle_error)r�r�rprzrZc�srt�}|dk	st�ttt||||j�}|�||||�}|�|�IdH|��IdH|j	dk	rh|j	�
�d|_dSr_)rror!�ERRORrrgr�r�r�r\rjr>)rWr�r�rprzr�r�r�r/r/r0ry�s �

z!RequestHandler.handle_parse_error)r`)rxNN)NN)3r+r,r-r.r��	__slots__rr rZ
LOG_FORMATrdZAbstractEventLooprVr�rr
r�str�intrUr^�propertyrIrrkZ
BaseTransportrl�
BaseExceptionrqrrurv�bytesr�r�rjr�r!r#r�r�r�r�rr�rnr�r�rry�
__classcell__r/r/rXr0r$As�'"��G "
1

�
�y�'��3��)BrdZasyncio.streamsr�r��collectionsr�
contextlibr�htmlrr��httpr�loggingr�typingrrr	r
rrr
rZyarl�abcrrZ
base_protocolrZhelpersrrrrrrrr�rrZstreamsrrZtcp_helpersrZweb_exceptionsrZweb_logr Zweb_requestr!Zweb_responser"r#�__all__Z
web_serverr'Z_RequestFactoryZ_RequestHandler�URLr�r{r%r&r$r/r/r/r0�<module>sd(����

Youez - 2016 - github.com/yon3zu
LinuXploit