Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/__pycache__/worker.cpython-311.pyc

�

�܋f�� �dZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZmZm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZ	ddlZejZn#e$rdZeZYnwxYwdZGd
�dej ��Z!Gd�de!��Z"dS)z%Async gunicorn worker for aiohttp.web�N)�	FrameType)�Any�	Awaitable�Callable�Optional�Union)�AccessLogFormat)�base)�web�)�
set_result)�Application)�AccessLogger)�GunicornWebWorker�GunicornUVLoopWebWorkerc���eZdZejZejZde	de	ddf�fd�Z
d�fd�Zdd�Zdd�Z
dd
�Z	dded	ddfd�Zdd
�Zdedeeddfd�Zdedeeddfd�Zede	ddfd���Zdedefd�Z�xZS)r�args�kw�returnNc�d��t��j|i|��d|_d|_d|_dS�Nr)�super�__init__�_task�	exit_code�_notify_waiter)�selfrr�	__class__s   ��a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/aiohttp/worker.pyrzGunicornWebWorker.__init__%s;��������$�%�"�%�%�%�37��
����>B�����c����tj�����tj��|_tj|j��t
�����dS�N)�asyncio�get_event_loop�close�new_event_loop�loop�set_event_loopr�init_process)rrs �rr)zGunicornWebWorker.init_process,s]����� � �&�&�(�(�(��*�,�,��	���t�y�)�)�)�
���������r c���|j�|�����|_	|j�|j��n*#t
$r|j�d��YnwxYw|j�|j�����|j�	��tj|j��dS)NzException in gunicorn worker)
r'�create_task�_runr�run_until_complete�	Exception�log�	exception�shutdown_asyncgensr%�sys�exitr�rs r�runzGunicornWebWorker.run5s����Y�*�*�4�9�9�;�;�7�7��
�	?��I�(�(���4�4�4�4���	?�	?�	?��H���=�>�>�>�>�>�	?�����	�$�$�T�Y�%A�%A�%C�%C�D�D�D��	���������� � � � � s�A�$A:�9A:c	��nK�d}t|jt��r|j}n�tj|j��rA|����d{V��}t|t
j��r
|}|j}n*|}n'td�	|j�����|�p|j
jr|jj
nd}tj||j|j
j||�|j
j��|j
jdzdz���}|����d{V��|j
jr|�|j
��nd}|}|�J�|j}|�J�|jD]3}tj|||���}|����d{V���4t3j��}		|jr�|���|j}
|jr.|
|jkr#d|_|j�d|��np|	t3j��kr?|j t3j!��kr#d|_|j�d|��n|�"���d{V��|j��n#tF$rYnwxYw|�$���d{V��dS)	NzUwsgi app should be either Application or async function returning Application, got {}�d�_)�logger�keepalive_timeout�
access_log�access_log_format�shutdown_timeout)�ssl_contextFzMax requests, shutting down: %sz!Parent changed, shutting down: %s)%�
isinstance�wsgirr#�iscoroutinefunctionr�	AppRunner�app�RuntimeError�format�cfg�	accesslogr/r;�	keepalive�_get_valid_log_formatr<�graceful_timeout�setup�is_ssl�_create_ssl_context�server�sockets�SockSite�start�os�getpid�alive�notify�requests_count�max_requests�info�ppid�getppid�_wait_next_notify�
BaseException�cleanup)r�runnerrCr@r;�ctxrN�sock�site�pid�cnts           rr,zGunicornWebWorker._runAs�������d�i��-�-�
	��)�C�C�
�
(���
3�
3�	������$�$�$�$�$�$�D��$��
�.�.�
����j�������?�?E�v�d�i�?P�?P���
�
�>�04��0B�L���,�,��J��]���x�"&�(�"4�%�"&�"<�"<��H�.�#�#�"&��!:�S�!@�2�!E�	�	�	�F��l�l�n�n��������48�H�O�M�d�&�&�t�x�0�0�0������!�!�!�����!�!�!��L�	�	�D��<�������D�
�*�*�,�,����������i�k�k��	��*�
3����
�
�
��+���$�3��t�/@�)@�)@�!&�D�J��H�M�M�"C�T�J�J�J�J��B�I�K�K�'�'�D�I�����,E�,E�!&�D�J��H�M�M�"E�t�L�L�L�L��0�0�2�2�2�2�2�2�2�2�2��*�
3����	�	�	��D�	�����n�n�����������s�<CJ�
J�J�asyncio.Future[bool]c��|���|j}|�J�|���x|_}|j�d|j|��|S)Ng�?)�_notify_waiter_doner'�
create_futurer�
call_later)rr'�waiters   rr[z#GunicornWebWorker._wait_next_notify�sb��� � �"�"�"��y������'+�'9�'9�';�';�;���f��	���S�$�":�F�C�C�C��
r ric�`�|�|j}|�t|d��||jur	d|_dSdS)NT)rr
)rris  rrfz%GunicornWebWorker._notify_waiter_done�sK���>��(�F����v�t�$�$�$��T�(�(�(�"&�D����)�(r c�
�|j�tj|jtjd��|j�tj|jtjd��|j�tj|jtjd��|j�tj|j	tjd��|j�tj
|jtj
d��|j�tj|j
tjd��tjtjd��tjtj
d��dS�NF)r'�add_signal_handler�signal�SIGQUIT�handle_quit�SIGTERM�handle_exit�SIGINT�SIGWINCH�handle_winch�SIGUSR1�handle_usr1�SIGABRT�handle_abort�siginterruptr4s r�init_signalszGunicornWebWorker.init_signals�s<��	
�	�$�$��N�D�,�f�n�d�	
�	
�	
�	
�	�$�$��N�D�,�f�n�d�	
�	
�	
�	
�	�$�$��M�4�+�V�]�D�	
�	
�	
�	
�	�$�$��O�T�.����	
�	
�	
�	
�	�$�$��N�D�,�f�n�d�	
�	
�	
�	
�	�$�$��N�D�-�v�~�t�	
�	
�	
�	��F�N�E�2�2�2���F�N�E�2�2�2�2�2r �sig�framec�p�d|_|j�|��|���dSrl)rTrF�
worker_intrf�rr|r}s   rrpzGunicornWebWorker.handle_quit�s;����
�	
����D�!�!�!�	
� � �"�"�"�"�"r c�~�d|_d|_|j�|��t	jd��dS)NFr)rTrrF�worker_abortr2r3r�s   rryzGunicornWebWorker.handle_abort�s7����
��������d�#�#�#��������r rF�
SSLContextc�@�t�td���tj|j��}|�|j|j��|j|_|j	r|�
|j	��|jr|�|j��|S)z~Creates SSLContext instance for usage in asyncio.create_server.

        See ssl.SSLSocket.__init__ for more details.
        NzSSL is not supported.)
�sslrDr��ssl_version�load_cert_chain�certfile�keyfile�	cert_reqs�verify_mode�ca_certs�load_verify_locations�ciphers�set_ciphers)rFr_s  rrMz%GunicornWebWorker._create_ssl_context�s����;��6�7�7�7��n�S�_�-�-�����C�L�#�+�6�6�6��-����<�	4��%�%�c�l�3�3�3��;�	)��O�O�C�K�(�(�(��
r �
source_formatc�r�||jkr|jStjd|��rt	d���|S)Nz%\([^\)]+\)z�Gunicorn's style options in form of `%(name)s` are not supported for the log formatting. Please use aiohttp's format specification to configure access log formatting: http://docs.aiohttp.org/en/stable/logging.html#format-specification)�DEFAULT_GUNICORN_LOG_FORMAT�DEFAULT_AIOHTTP_LOG_FORMAT�re�search�
ValueError)rr�s  rrIz'GunicornWebWorker._get_valid_log_format�sL���D�<�<�<��2�2�
�Y�~�}�
5�
5�		!��(���
�!� r �rN)rrdr")�__name__�
__module__�__qualname__r�
LOG_FORMATr��GunicornAccessLogFormat�defaultr�rrr)r5r,r[rrfr{�intrrpry�staticmethodrM�strrI�
__classcell__�rs@rrr s��������!-�!8��"9�"A��C�c�C��C��C�C�C�C�C�C�������
!�
!�
!�
!�@�@�@�@�D����:>�	'�	'��5�6�	'�	
�	'�	'�	'�	'�3�3�3�3�D#�s�#�8�I�+>�#�4�#�#�#�#����H�Y�,?��D��������������\��"!�3�!�3�!�!�!�!�!�!�!�!r rc� ��eZdZd�fd�Z�xZS)rrNc����ddl}tj�����tj|�����t
�����dSr)�uvloopr#r$r%�set_event_loop_policy�EventLoopPolicyrr))rr�rs  �rr)z$GunicornUVLoopWebWorker.init_process�sd����
�
�
�	�� � �&�&�(�(�(�
	�%�f�&<�&<�&>�&>�?�?�?�
���������r r�)r�r�r�r)r�r�s@rrr�s=����������������r r)#�__doc__r#rRr�rnr2�typesr�typingrrrrr�gunicorn.configr	r��gunicorn.workersr
�aiohttpr�helpersr
�web_appr�web_logrr�r��ImportError�object�__all__�Workerrr�r r�<module>r�s���+�+�����	�	�	�	�	�	�	�	�
�
�
�
�
�
�
�
�������<�<�<�<�<�<�<�<�<�<�<�<�<�<�F�F�F�F�F�F�!�!�!�!�!�!������������� � � � � � �!�!�!�!�!�!���J�J�J���J�J������
�C��J�J�J�����
;��G!�G!�G!�G!�G!���G!�G!�G!�T
�
�
�
�
�/�
�
�
�
�
s�A�	A(�'A(

Hacked By AnonymousFox1.0, Coded By AnonymousFox