[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.137.171.71: ~ $


���ZCF�@s�ddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddl
Z
ddlmZmZddlmZddlmZmZmZdd	lmZmZdd
lmZddlmZmZmZddlmZdd
lm Z ddl!m"Z"dZ#ej$ddej%iidddde
j&d��
Z'Gdd�de(�Z)Gdd�dejj*ej+�Z,dS)�N)�deque)�suppress)�escape�)�helpers�http)�CeilTimeout)�HttpProcessingError�HttpRequestParser�StreamWriter)�
access_logger�
server_logger)�
EMPTY_PAYLOAD)�tcp_cork�
tcp_keepalive�tcp_nodelay)�
HTTPException)�BaseRequest)�Response�RequestHandler�RequestPayloadErrorZUNKNOWN�/TFc@seZdZdZdS)rzPayload parsing error.N)�__name__�
__module__�__qualname__�__doc__�rr�/web_protocol.pyrscs�eZdZdZdZdZdZddddd	d
dedej	d
e
dej	jdddddddddd�fdd�Zdd�Z
edd��Zddd�Z�fd d!�Z�fd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zdd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>ddd?d@�Z dddAdB�Z!�S)Cra�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

    rFr�loopN�keepalive_timeout�KrT�logger�access_log_class�
access_log�access_log_format�debug�
max_line_sizei��max_headersi��max_field_size�lingering_timeg$@csmt�jd|�|dk	r%|n	tj�|_||_|j|_|j|_	||_
d|_d|_||_
t|
�|_t�|_d|_d|_d|_|jj|j��|_d|_d|_t||d|
d|d|dt�|_d|_d|_||_|	|_ ||_!|rN|||�|_"n	d|_"d|_#d|_$dS)Nr�Fr&r(r'Zpayload_exception)%�super�__init__�asyncioZget_event_loop�_loop�_managerZrequest_handler�_request_handlerZrequest_factory�_request_factory�_tcp_keepalive�_keepalive_time�_keepalive_handle�_keepalive_timeout�float�_lingering_timer�	_messages�
_message_tail�_waiter�_error_handler�create_task�start�
_task_handler�_upgrade�_payload_parserr
r�_request_parser�	transport�_reading_pausedr!r%r#r�_close�_force_close)�self�managerrrrr!r"r#r$r%r&r'r(r))�	__class__rrr,MsD
!																		zRequestHandler.__init__cCs+dj|jj|jdk	r$dnd�S)Nz<{} {}>Z	connectedZdisconnected)�formatrHrrB)rFrrr�__repr__�s	zRequestHandler.__repr__cCs|jS)N)r5)rFrrrr�sz RequestHandler.keepalive_timeoutg.@c�s�d|_|jdk	r%|jj�|jr;|jj�ttjtj��lt|d|j	��O|j
r�|j
j�r�|j
IdH|jr�|jj�r�|jIdHWdQRXWdQRX|jr�|jj�|j
dk	r�|j
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.TNr)rEr4�cancelr:rr-�CancelledError�TimeoutErrorrr.r;�doner>rB�close)rF�timeoutrrr�shutdown�s 	
	
	

zRequestHandler.shutdowncs]t�j|�||_|jr,t|�t|d�t|d�|jj||�dS)NFT)r+�connection_maderBr2rrrr/)rFrB)rHrrrR�s		


zRequestHandler.connection_madecs�|jj||�t�j|�d|_d|_d|_d|_d|_d|_|jdk	ru|jj	�|j
r�|j
j	�|jdk	r�|jj	�d|_
|jdk	r�|jj
�d|_dS)NT)r/�connection_lostr+rEr1r0rArBr4rKr>r;r@Zfeed_eof)rF�exc)rHrrrS�s$						
	

	
zRequestHandler.connection_lostcCsG|jdkst�||_|jrC|jj|j�d|_dS)Nr*)r@�AssertionErrorr9�	feed_data)rF�parserrrr�
set_parser�s
		zRequestHandler.set_parsercCsdS)Nr)rFrrr�eof_received�szRequestHandler.eof_receivedc
Cs|js|jrdS|jdkr�|jr�y|jj|�\}}}Wn�tk
r�}zK|jj|j	t
||j|j�d||j��|_
|j�WYdd}~Xqtk
r}zE|jj|j	t
||j|j�d|��|_
|j�WYdd}~XqX|r�x9|D]1\}}|jd7_|jj||f�q-W|j}|dk	r�|j�s�|jd�||_|r|r||_n^|jdkr�|jr�|r�|j|7_n.|r|jj|�\}	}|	r|j�dS)Ni�i�r)rErDr@r?rArVr	r.r<�handle_parse_errorrrB�messager;rO�	Exception�_request_countr8�appendr:rN�
set_resultZ	_upgradedr9)
rF�dataZmessagesZupgraded�tailrT�msg�payload�waiter�eofrrr�
data_received�sD			
	zRequestHandler.data_receivedcCs,||_|jr(|jj�d|_dS)zMSet keep-alive connection mode.

        :param bool val: new state.
        N)�
_keepaliver4rK)rF�valrrr�
keep_alives		
zRequestHandler.keep_alivecCs#d|_|jr|jj�dS)ziStop accepting new pipelinig messages and close
        connection when handlers done processing messagesTN)rDr:rK)rFrrrrOs		zRequestHandler.closecCs^d|_|jr|jj�|jdk	rZ|rD|jjd�|jj�d|_dS)zForce close connectionTNs
)rEr:rKrB�writerO)rF�send_last_heartbeatrrr�force_close"s		

zRequestHandler.force_closecCs)|jdk	r%|jj|||�dS)N)r�log)rF�request�response�timerrr�
log_access-szRequestHandler.log_accesscOs |jr|jj||�dS)N)r%r!)rF�args�kwrrr�	log_debug1s	zRequestHandler.log_debugcOs|jj||�dS)N)r!�	exception)rFrrrsrrr�
log_exception5szRequestHandler.log_exceptioncCs{|js|jrdS|j|j}|jrY|jj�|krY|jdd�dS|jj|j	|j
�|_dS)NrkT)rErgr3r5r:r.rprlZ
call_later�KEEPALIVE_RESCHEDULE_DELAY�_process_keepaliver4)rF�nextrrrrx8s		z!RequestHandler._process_keepalivec
CsE|jsAy|jj�Wntttfk
r7YnXd|_dS)NT)rCrB�
pause_reading�AttributeError�NotImplementedError�RuntimeError)rFrrrrzIs	zRequestHandler.pause_readingc
CsE|jrAy|jj�Wntttfk
r7YnXd|_dS)NF)rCrB�resume_readingr{r|r})rFrrrr~Qs	zRequestHandler.resume_readingc8�s�|j}|j}|j}|j}xW|js}|js�z<y|j�|_|jIdHWntj	k
rsPYnXWdd|_X|jj
�\}}|jr�|j�}|j
d7_
t||j|�}|j|||||�}	z�yHy|j|	�IdH}
Wn�tk
r6}z|}
WYdd}~Xn�tj	k
rX|jd�PYn�tjk
r�|jd�|j|	d�}
YnYtk
r�}z|j|	d|�}
WYdd}~Xn Xt|
t�r�tjdt�|
j|	�IdH|
j�IdH|
j|_|jr7|j|	|
|j�|�|j �s5|j!}|jr|r|jd|�|j�}||}
t"tjtj	��mxe|j �r�||
kr�t#|
||�}t$|d	|��|j%�IdHWdQRX|j�}q�WWdQRX|j �r5|jr5|jd
�|j&�Wn�tj	k
r[|jd�PYn�t'k
r�}z+|j(r�|j)dd
|�|j*�WYdd}~XnBtk
r�}z"|j)dd
|�|j*�WYdd}~XnXWd|jdkr
|jd�no|jsy|jrx|j+rx|dk	ry|jj�}||_,|j-dkry|j.|||j/�|_-nPXq'W|js�d|_|jdk	r�|j0dkr�|jj&�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 disconnectionzRequest handler timed out.i�i�zlreturning HTTPException object is deprecated (#2415) and will be removed, please raise the exception insteadz'Start lingering close timer for %s sec.rzUncompleted request.z'Ignored premature client disconnection zUnhandled runtime exception�exc_infozUnhandled exceptionz'Ignored premature client disconnection.)1r.r>r/r5rEr8Z
create_futurer:r-rL�popleftr#rpZrequests_countrrBr1r0rrtrM�handle_errorr\�
isinstance�warnings�warn�DeprecationWarning�prepare�	write_eofrirgrqZis_eofr7r�minrZreadanyrOr}r%rvrlrDr3r4Zcall_atrxr;)rFr�handlerrGrr[rcZnow�writerrn�resprTr)Zend_trPrrrr=Ys�						

	

(		


	
!				zRequestHandler.starti�cCs�|jdd|�|dkr�d}|jr{tt��;tj�}t|�}|d7}||7}|d7}WdQRXq�|d7}d	|d
}n|}td|d|d
d�}|j�|j	j
dks�|jdkr�|j�|S)z�Handle errors.

        Returns HTTP response with specific status code. Logs additional
        information. It always closes current connection.zError handling requestri�z"<h1>500 Internal Server Error</h1>z<br><h2>Traceback:</h2>
<pre>z</pre>NzServer got itself in troublezA<html><head><title>500 Internal Server Error</title></head><body>z</body></html>�status�textZcontent_typez	text/htmlr)rvr%rr\�	traceback�
format_exc�html_escaperrlr�Zoutput_sizerB)rFrnr�rTr[rb�tbr�rrrr��s$	




!
zRequestHandler.handle_errorc�s�ttt||d|j�}|j||||�}|j|�IdH|j�IdH|jdk	rs|jj�d|_	dS)N)
r�ERRORrr.r�r�r�rBrOr;)rFr�r�rTr[rnr�rrrrZ�s
z!RequestHandler.handle_parse_error)"rrrrr]rgrwr
rZAccessLoggerrZ
LOG_FORMATr,rJ�propertyrrQrRrSrXrYrfrirOrlrqrtrvrxrzr~r=r�rZrr)rHrr"sH&		/	1
| )rr)-r-Zasyncio.streamsZhttp.serverrr�r��collectionsr�
contextlibrZhtmlrr�Zyarl�rrr	r
rrmrr
ZstreamsrZtcp_helpersrrrZweb_exceptionsrZweb_requestrZweb_responser�__all__ZRawRequestMessageZ
HttpVersion10ZURLr�r\rZFlowControlMixinZProtocolrrrrr�<module>s.!

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 947 B 0644
__init__.cpython-35.pyc File 947 B 0644
abc.cpython-35.opt-1.pyc File 6.08 KB 0644
abc.cpython-35.pyc File 6.08 KB 0644
client.cpython-35.opt-1.pyc File 22.11 KB 0644
client.cpython-35.pyc File 22.11 KB 0644
client_exceptions.cpython-35.opt-1.pyc File 8.04 KB 0644
client_exceptions.cpython-35.pyc File 8.04 KB 0644
client_proto.cpython-35.opt-1.pyc File 5.01 KB 0644
client_proto.cpython-35.pyc File 5.01 KB 0644
client_reqrep.cpython-35.opt-1.pyc File 23.56 KB 0644
client_reqrep.cpython-35.pyc File 23.69 KB 0644
client_ws.cpython-35.opt-1.pyc File 8.09 KB 0644
client_ws.cpython-35.pyc File 8.09 KB 0644
connector.cpython-35.opt-1.pyc File 24.95 KB 0644
connector.cpython-35.pyc File 24.95 KB 0644
cookiejar.cpython-35.opt-1.pyc File 8.4 KB 0644
cookiejar.cpython-35.pyc File 8.4 KB 0644
formdata.cpython-35.opt-1.pyc File 4.19 KB 0644
formdata.cpython-35.pyc File 4.19 KB 0644
frozenlist.cpython-35.opt-1.pyc File 2.73 KB 0644
frozenlist.cpython-35.pyc File 2.73 KB 0644
hdrs.cpython-35.opt-1.pyc File 3.72 KB 0644
hdrs.cpython-35.pyc File 3.72 KB 0644
helpers.cpython-35.opt-1.pyc File 24.01 KB 0644
helpers.cpython-35.pyc File 24.01 KB 0644
http.cpython-35.opt-1.pyc File 1.26 KB 0644
http.cpython-35.pyc File 1.26 KB 0644
http_exceptions.cpython-35.opt-1.pyc File 3.55 KB 0644
http_exceptions.cpython-35.pyc File 3.55 KB 0644
http_parser.cpython-35.opt-1.pyc File 14.1 KB 0644
http_parser.cpython-35.pyc File 14.16 KB 0644
http_websocket.cpython-35.opt-1.pyc File 13.92 KB 0644
http_websocket.cpython-35.pyc File 14.01 KB 0644
http_writer.cpython-35.opt-1.pyc File 4.06 KB 0644
http_writer.cpython-35.pyc File 4.06 KB 0644
locks.cpython-35.opt-1.pyc File 1.39 KB 0644
locks.cpython-35.pyc File 1.39 KB 0644
log.cpython-35.opt-1.pyc File 409 B 0644
log.cpython-35.pyc File 409 B 0644
multipart.cpython-35.opt-1.pyc File 25.14 KB 0644
multipart.cpython-35.pyc File 25.59 KB 0644
payload.cpython-35.opt-1.pyc File 9.29 KB 0644
payload.cpython-35.pyc File 9.42 KB 0644
payload_streamer.cpython-35.opt-1.pyc File 2.58 KB 0644
payload_streamer.cpython-35.pyc File 2.58 KB 0644
pytest_plugin.cpython-35.opt-1.pyc File 9.22 KB 0644
pytest_plugin.cpython-35.pyc File 9.28 KB 0644
resolver.cpython-35.opt-1.pyc File 3.33 KB 0644
resolver.cpython-35.pyc File 3.33 KB 0644
signals.cpython-35.opt-1.pyc File 1.23 KB 0644
signals.cpython-35.pyc File 1.23 KB 0644
streams.cpython-35.opt-1.pyc File 16.41 KB 0644
streams.cpython-35.pyc File 16.74 KB 0644
tcp_helpers.cpython-35.opt-1.pyc File 1.37 KB 0644
tcp_helpers.cpython-35.pyc File 1.37 KB 0644
test_utils.cpython-35.opt-1.pyc File 17.71 KB 0644
test_utils.cpython-35.pyc File 17.76 KB 0644
tracing.cpython-35.opt-1.pyc File 11.2 KB 0644
tracing.cpython-35.pyc File 11.2 KB 0644
web.cpython-35.opt-1.pyc File 4.65 KB 0644
web.cpython-35.pyc File 4.65 KB 0644
web_app.cpython-35.opt-1.pyc File 9.78 KB 0644
web_app.cpython-35.pyc File 10.24 KB 0644
web_exceptions.cpython-35.opt-1.pyc File 11.98 KB 0644
web_exceptions.cpython-35.pyc File 11.98 KB 0644
web_fileresponse.cpython-35.opt-1.pyc File 5.44 KB 0644
web_fileresponse.cpython-35.pyc File 5.44 KB 0644
web_middlewares.cpython-35.opt-1.pyc File 2.63 KB 0644
web_middlewares.cpython-35.pyc File 2.63 KB 0644
web_protocol.cpython-35.opt-1.pyc File 13.36 KB 0644
web_protocol.cpython-35.pyc File 13.39 KB 0644
web_request.cpython-35.opt-1.pyc File 19.16 KB 0644
web_request.cpython-35.pyc File 19.16 KB 0644
web_response.cpython-35.opt-1.pyc File 17.11 KB 0644
web_response.cpython-35.pyc File 17.84 KB 0644
web_runner.cpython-35.opt-1.pyc File 9.55 KB 0644
web_runner.cpython-35.pyc File 9.55 KB 0644
web_server.cpython-35.opt-1.pyc File 2.04 KB 0644
web_server.cpython-35.pyc File 2.04 KB 0644
web_urldispatcher.cpython-35.opt-1.pyc File 37.12 KB 0644
web_urldispatcher.cpython-35.pyc File 38.15 KB 0644
web_ws.cpython-35.opt-1.pyc File 12.52 KB 0644
web_ws.cpython-35.pyc File 12.52 KB 0644
worker.cpython-35.opt-1.pyc File 6.4 KB 0644
worker.cpython-35.pyc File 6.4 KB 0644