[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@13.58.224.40: ~ $
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]ZUNKNOWN�/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.r/r&=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_timeoutrrB�access_log_classrD�access_log_formatrC�
max_line_size�max_headers�max_field_size�lingering_time�read_bufsizer')�manager�looprHrrBrIrDrJrCrKrLrMrNrOc
	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�)rKrMrLZpayload_exception)!�super�__init__r0r1rGr2Zrequest_handlerr3Zrequest_factoryr4r5r6r7r8�floatr9rr:r;r<r=r>r?r@rr%rArBrCrDrrErF)�selfrPrQrHrrBrIrDrJrCrKrLrMrNrO��	__class__r.r/rT�sR��
�
�zRequestHandler.__init__)�returncCsd�|jj|jdk	rdnd�S)Nz<{} {}>Z	connectedZdisconnected)�formatrXr*�	transport�rVr.r.r/�__repr__�s�zRequestHandler.__repr__cCs|jS�N)r8r\r.r.r/rH�sz RequestHandler.keepalive_timeout�.@N)�timeoutrYc
�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�rQ)rFr7�cancelr<r�asyncio�CancelledError�TimeoutErrorr�_loopr=�donerG�_cancelr>r[�close)rVr`r.r.r/�shutdown�s$



 



zRequestHandler.shutdown)r[rYcsXt��|�ttj|�}|jr&t|�|j�|�	��|_
|jdk	sFt�|j�||�dSr^)
rS�connection_maderrcZ	Transportr5rrf�create_task�startr>r2�AssertionError)rVr[Zreal_transportrWr.r/rk�szRequestHandler.connection_made)�excrYcs�|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)r2�connection_lostrSrFr4r3rAr7rbrG�ConnectionResetErrorrhr=r>r<r@Zfeed_eof)rVrorWr.r/rps2











zRequestHandler.connection_lost)�parserrYcCs2|jdkst�||_|jr.|j�|j�d|_dS)NrR)r@rnr;�	feed_data)rVrrr.r.r/�
set_parser&s
zRequestHandler.set_parsercCsdSr^r.r\r.r.r/�eof_received0szRequestHandler.eof_received)�datarYc
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)rFrEr@r?rArnrsrrfrl�handle_parse_errorr�messager=ri�	Exceptionr0r:�appendr<rgZ
set_resultr;)
rVrvZmessagesZupgraded�tailro�msg�payloadZwaiter�eofr.r.r/�
data_received3sL
���


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

        :param bool val: new state.
        N)r1r7rb)rVr�r.r.r/�
keep_aliveds
zRequestHandler.keep_alivecCsd|_|jr|j��dS)ziStop accepting new pipelinig messages and close
        connection when handlers done processing messagesTN)rEr<rbr\r.r.r/rinszRequestHandler.closecCs4d|_|jr|j��|jdk	r0|j��d|_dS)zForce close connectionTN)rFr<rbr[rir\r.r.r/�force_closeus


zRequestHandler.force_close)�request�response�timerYcCs(|jdk	r$|j�|||j��|�dSr^)r�logrfr�)rVr�r�r�r.r.r/�
log_access~s
zRequestHandler.log_access)�args�kwrYcOs|jr|jj||�dSr^)rCrB�rVr�r�r.r.r/�	log_debug�szRequestHandler.log_debugcOs|jj||�dSr^)rBZ	exceptionr�r.r.r/�
log_exception�szRequestHandler.log_exceptioncCsT|js|jsdS|j|j}|jr<|j��|kr<|��dS|j�|j	|j
�|_dSr^)rFr1r6r8r<rfr�r�Z
call_later�KEEPALIVE_RESCHEDULE_DELAY�_process_keepaliver7)rV�nextr.r.r/r��s�z!RequestHandler._process_keepalive)r��
start_timerYc
�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�rw)r3rnrGrr"r�r�r�r��finish_responsercrdrer��handle_errorrz)rVr�r��respro�resetr.r.r/�_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.razUncompleted request.z'Ignored premature client disconnection zUnhandled runtime exceptionr�zUnhandled exception)1rfr>rnr2r8r4r3rFr:r<Z
create_futurercrd�popleftr�Zrequests_countrr[r�r1rEr6r7Zcall_atr�rlr��ConnectionError�getattr�warnings�warn�DeprecationWarning�boolr�Zis_eofr9rrerZreadanyriZ
set_exceptionr&�RuntimeErrorrCr�r�rzr=)rVrQZhandlerrPrHr�ryr~rm�writerr�Znow�taskr�rNZend_tror.r.r/rm�s�	



�

�



�zRequestHandler.start)r�r�r�rYc�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.
        NFrRz+Missing return statement on request handlerz7Web-handler should return a response instance, got {!r}T)rAZset_upgradedr?r;rs�prepare�AttributeErrorr�rZ�	write_eofr�r�)rVr�r�r�Zprepare_methr.r.r/r�4s0	


��
zRequestHandler.finish_responserw)r�r�roryrYc
	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�Zcontent_typer)r�rZINTERNAL_SERVER_ERRORrZ�descriptionrCrrz�	traceback�
format_excr��get�html_escaper"r�r�Zoutput_sizer[)
rVr�r�roryZctr�r}�tbr�r.r.r/r�Xs6

��zRequestHandler.handle_error)r�r�roryrYc�srt�}|dk	st�ttt||||j�}|�||||�}|�|�IdH|��IdH|j	dk	rh|j	�
�d|_dSr^)rrnr!�ERRORrrfr�r�r�r[rir=)rVr�r�roryr�r�r�r.r.r/rx�s �

z!RequestHandler.handle_parse_error)r_)rwNN)NN)3r*r+r,r-r��	__slots__rr rZ
LOG_FORMATrcZAbstractEventLooprUr�rr
r�str�intrTr]�propertyrHrrjZ
BaseTransportrk�
BaseExceptionrprrtru�bytesr�r�rir�r!r#r�r�r�r�rr�rmr�r�rrx�
__classcell__r.r.rWr/r$As�'"��G "
1

�
�y�'��3��)BrcZasyncio.streamsr�r��collectionsr�
contextlibrZhtmlrr�ZhttprZloggingr�typingrrr	r
rrr
rZyarl�abcrrZ
base_protocolrZhelpersrrrrrrrr�rrZstreamsrrZtcp_helpersrZweb_exceptionsrZweb_logr Zweb_requestr!Zweb_responser"r#�__all__Z
web_serverr'Z_RequestFactoryZ_RequestHandlerZURLr�rzr%r&r$r.r.r.r/�<module>sd(����

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 3.61 KB 0644
__init__.cpython-38.pyc File 3.61 KB 0644
abc.cpython-38.opt-1.pyc File 8.11 KB 0644
abc.cpython-38.pyc File 8.11 KB 0644
base_protocol.cpython-38.opt-1.pyc File 2.49 KB 0644
base_protocol.cpython-38.pyc File 2.58 KB 0644
client.cpython-38.opt-1.pyc File 27.85 KB 0644
client.cpython-38.pyc File 28 KB 0644
client_exceptions.cpython-38.opt-1.pyc File 10.03 KB 0644
client_exceptions.cpython-38.pyc File 10.03 KB 0644
client_proto.cpython-38.opt-1.pyc File 5.99 KB 0644
client_proto.cpython-38.pyc File 5.99 KB 0644
client_reqrep.cpython-38.opt-1.pyc File 26.76 KB 0644
client_reqrep.cpython-38.pyc File 27.02 KB 0644
client_ws.cpython-38.opt-1.pyc File 8.65 KB 0644
client_ws.cpython-38.pyc File 8.65 KB 0644
connector.cpython-38.opt-1.pyc File 30.14 KB 0644
connector.cpython-38.pyc File 30.27 KB 0644
cookiejar.cpython-38.opt-1.pyc File 9.07 KB 0644
cookiejar.cpython-38.pyc File 9.11 KB 0644
formdata.cpython-38.opt-1.pyc File 4.38 KB 0644
formdata.cpython-38.pyc File 4.41 KB 0644
frozenlist.cpython-38.opt-1.pyc File 2.56 KB 0644
frozenlist.cpython-38.pyc File 2.56 KB 0644
hdrs.cpython-38.opt-1.pyc File 3.53 KB 0644
hdrs.cpython-38.pyc File 3.53 KB 0644
helpers.cpython-38.opt-1.pyc File 22.43 KB 0644
helpers.cpython-38.pyc File 22.43 KB 0644
http.cpython-38.opt-1.pyc File 1.21 KB 0644
http.cpython-38.pyc File 1.21 KB 0644
http_exceptions.cpython-38.opt-1.pyc File 4.17 KB 0644
http_exceptions.cpython-38.pyc File 4.17 KB 0644
http_parser.cpython-38.opt-1.pyc File 15.58 KB 0644
http_parser.cpython-38.pyc File 15.66 KB 0644
http_websocket.cpython-38.opt-1.pyc File 14.34 KB 0644
http_websocket.cpython-38.pyc File 14.46 KB 0644
http_writer.cpython-38.opt-1.pyc File 4.88 KB 0644
http_writer.cpython-38.pyc File 4.88 KB 0644
locks.cpython-38.opt-1.pyc File 1.65 KB 0644
locks.cpython-38.pyc File 1.65 KB 0644
log.cpython-38.opt-1.pyc File 438 B 0644
log.cpython-38.pyc File 438 B 0644
multipart.cpython-38.opt-1.pyc File 25.11 KB 0644
multipart.cpython-38.pyc File 25.55 KB 0644
payload.cpython-38.opt-1.pyc File 12.8 KB 0644
payload.cpython-38.pyc File 12.8 KB 0644
payload_streamer.cpython-38.opt-1.pyc File 3.15 KB 0644
payload_streamer.cpython-38.pyc File 3.15 KB 0644
pytest_plugin.cpython-38.opt-1.pyc File 9.17 KB 0644
pytest_plugin.cpython-38.pyc File 9.22 KB 0644
resolver.cpython-38.opt-1.pyc File 3.7 KB 0644
resolver.cpython-38.pyc File 3.7 KB 0644
signals.cpython-38.opt-1.pyc File 1.26 KB 0644
signals.cpython-38.pyc File 1.26 KB 0644
streams.cpython-38.opt-1.pyc File 17.57 KB 0644
streams.cpython-38.pyc File 17.84 KB 0644
tcp_helpers.cpython-38.opt-1.pyc File 1.08 KB 0644
tcp_helpers.cpython-38.pyc File 1.08 KB 0644
test_utils.cpython-38.opt-1.pyc File 20.44 KB 0644
test_utils.cpython-38.pyc File 20.58 KB 0644
tracing.cpython-38.opt-1.pyc File 13.98 KB 0644
tracing.cpython-38.pyc File 13.98 KB 0644
typedefs.cpython-38.opt-1.pyc File 1.28 KB 0644
typedefs.cpython-38.pyc File 1.28 KB 0644
web.cpython-38.opt-1.pyc File 9.48 KB 0644
web.cpython-38.pyc File 9.48 KB 0644
web_app.cpython-38.opt-1.pyc File 14.85 KB 0644
web_app.cpython-38.pyc File 14.89 KB 0644
web_exceptions.cpython-38.opt-1.pyc File 11.73 KB 0644
web_exceptions.cpython-38.pyc File 11.73 KB 0644
web_fileresponse.cpython-38.opt-1.pyc File 4.47 KB 0644
web_fileresponse.cpython-38.pyc File 4.51 KB 0644
web_log.cpython-38.opt-1.pyc File 6.96 KB 0644
web_log.cpython-38.pyc File 6.96 KB 0644
web_middlewares.cpython-38.opt-1.pyc File 3.72 KB 0644
web_middlewares.cpython-38.pyc File 3.8 KB 0644
web_protocol.cpython-38.opt-1.pyc File 15.28 KB 0644
web_protocol.cpython-38.pyc File 15.46 KB 0644
web_request.cpython-38.opt-1.pyc File 22.07 KB 0644
web_request.cpython-38.pyc File 22.18 KB 0644
web_response.cpython-38.opt-1.pyc File 18.96 KB 0644
web_response.cpython-38.pyc File 19.87 KB 0644
web_routedef.cpython-38.opt-1.pyc File 7.62 KB 0644
web_routedef.cpython-38.pyc File 7.62 KB 0644
web_runner.cpython-38.opt-1.pyc File 11.35 KB 0644
web_runner.cpython-38.pyc File 11.45 KB 0644
web_server.cpython-38.opt-1.pyc File 2.69 KB 0644
web_server.cpython-38.pyc File 2.69 KB 0644
web_urldispatcher.cpython-38.opt-1.pyc File 40.38 KB 0644
web_urldispatcher.cpython-38.pyc File 41.2 KB 0644
web_ws.cpython-38.opt-1.pyc File 12.77 KB 0644
web_ws.cpython-38.pyc File 12.91 KB 0644
worker.cpython-38.opt-1.pyc File 6.7 KB 0644
worker.cpython-38.pyc File 6.77 KB 0644