$70 GRAYBYTE WORDPRESS FILE MANAGER $50

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/ssa/__pycache__/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/ssa/__pycache__//agent.cpython-311.pyc
�

EH�i����dZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZd
ZdZdZGd
�d��ZdS)zH
This module contains contains classes implementing SSA Agent behaviour
�N)�ThreadPoolExecutor)�current_thread�)�
agent_sock)�SSAError)�
create_socket)�RequestProcessor�2i �
c��eZdZdZd�Zd�Zdd�Zehd���ZdZ	e
jd	��Ze
d
ddefd���Zed
edefd���Zdd�Zdddefd�ZdS)�SimpleAgentz 
    SSA Simple Agent class
    c���tjd��|_t��|_tt���|_tj	|j
��|���dS)N�agent)�max_workers)�logging�	getLogger�loggerr	�request_processorr�MAX_WORKERS�executor�atexit�register�	_shutdown�listen��selfs �@/opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/agent.py�__init__zSimpleAgent.__init__+sW���'��0�0���!1�!3�!3���*�{�C�C�C��
�����'�'�'����
�
�
�
�
�c�<�|j�d���dS)z-Gracefully shutdown the thread pool executor.F)�waitN)r�shutdownrs rrzSimpleAgent._shutdown3s!���
���E��*�*�*�*�*r�returnNc���tt��}	|���\}}|j�|j|��|j�d���R)z(
        Start listening socket
        TzhreadPool] Submitted task)rr�acceptr�submit�handler�debug)r�_socket�
connection�addresss    rrzSimpleAgent.listen7s`�� �
�+�+��	=�")�.�.�"2�"2��J���M� � ���j�9�9�9��K���;�<�<�<�	=r>�url�duration�	timestamp�	wordpress�hitting_limits�throttled_time�io_throttled_timei�z#^https?\??://[^\s<>"{}|\\^`\[\]]+\Zr*�
socket objectc��|�tjtjt	jd����}t	jd|��\}}}|S)z�
        Get the UID of the peer process using SO_PEERCRED.
        :param connection: socket object
        :return: UID of the connecting process
        �3i)�
getsockopt�
socket_module�
SOL_SOCKET�SO_PEERCRED�struct�calcsize�unpack)r*�cred�_pid�uid�_gids     r�
_get_peer_uidzSimpleAgent._get_peer_uidLsP���$�$��$��%��O�D�!�!�
�
��
!�-��d�3�3���c�4��
r�datac��t|t��r|sdSt|�����|jkrdSt|dt
��r4|d���r|d���sdSt|dt
��r|dsdSt|d��|j	krdS|j
�|d��sdSt|dt��s't|dt��r|ddkrdSt|dt��sdSt|dt��s't|dt��r|ddkrdSt|dt��s't|dt��r|ddkrdSt|d	t��sdSd
S)aP
        Validate that input data contains exactly the expected metric fields
        with the correct value types. The PHP extension always sends all 7
        fields (see dump.c), so we require an exact key match and enforce
        the types produced by the C formatter to reject both malformed and
        spoofed payloads.
        Fr.r,r-rr0r1r2r/T)�
isinstance�dict�set�keys�_REQUIRED_FIELDS�str�isascii�isdigit�len�_MAX_URL_LENGTH�_URL_RE�match�bool�int)�clsrBs  r�_validate_inputzSimpleAgent._validate_input[s���$��%�%�	�T�	��5��t�y�y�{�{���s�3�3�3��5��$�{�+�S�1�1�	��k�9J�9R�9R�9T�9T�	�\`�al�\m�\u�\u�\w�\w�	��5��$�u�+�s�+�+�	�4��;�	��5��t�E�{���c�1�1�1��5��{� � ��e��-�-�	��5��d�:�&��-�-�	��t�J�/��5�5�	�9=�j�9I�A�9M�9M��5��$�/�0�$�7�7�	��5��d�+�,�d�3�3�	��t�$4�5�s�;�;�	�?C�DT�?U�XY�?Y�?Y��5��d�.�/��6�6�	��t�$7�8�#�>�>�	�BF�GZ�B[�^_�B_�B_��5��$�{�+�T�2�2�	��5��trc	���	|�|��}nr#ttjf$rY}|j�dt��jt|����|���Yd}~dSd}~wwxYw|�	t��|�d���}	|�|��}|�
|��s�|j�dt��j|t|t ��r!t#|�����nt'|��j��	|���|���dS|j�|���n#t.j$rE}|j�dt��j|t|����Yd}~n�d}~wt2t4jt8f$rD}|j�dt��jt|����Yd}~nTd}~wt:$rD}|j�dt��jt|����Yd}~nd}~wwxYw|���|���dS#|���|���wxYw)	z�
        Handle incoming connection
        :param connection: socket object usable to
        send and receive data on the connection
        z'[%s] Failed to get peer credentials: %sN�ignore)�errorsz2[%s] Rejected invalid payload from UID=%d: keys=%sz+[%s] Connection timed out (peer UID=%d): %szHandled exception in [%s]: %sz Unexpected exception in [%s]: %s)rA�OSErrorr:�errorrr�namerI�close�
settimeout�SOCKET_READ_TIMEOUT�makefile�
read_inputrS�warningrDrE�sortedrG�type�__name__rr'r7�timeoutr�json�JSONDecodeError�
ValueError�	Exception�	exception)rr*�peer_uid�e�fileobj�
input_datas      rr'zSimpleAgent.handles7��	��)�)�*�5�5�H�H�����&�	�	�	��K���9�� � �%�s�1�v�v�
/�
/�
/�
�������F�F�F�F�F�����	����	���1�2�2�2��%�%�X�%�6�6��	�����1�1�J��'�'�
�3�3�
���#�#�H�"�$�$�)�8�1;�J��1M�1M�l�F�:�?�?�,�,�-�-�-�SW�Xb�Sc�Sc�Sl�n�n�n��
�M�M�O�O�O���������
�"�)�)�*�5�5�5�5���$�	I�	I�	I��K��� M� .� 0� 0� 5�x��Q���
I�
I�
I�
I�
I�
I�
I�
I������$�.�
�;�	=�	=�	=��K���=�,�.�.�3�S��V�V�
=�
=�
=�
=�
=�
=�
=�
=������	A�	A�	A��K�!�!�"D�"0�"2�"2�"7��Q���
A�
A�
A�
A�
A�
A�
A�
A�����	A����
�M�M�O�O�O����������
�M�M�O�O�O����������sp��B�AB�B�;B F"�F"� K
�"J �1;G1�,K
�1J �:I�
K
�
J �:J�K
�J � K
�
*K7�fileiozfile objectc��|�t��}|j�dt	��jt
|�������|j�dt	��j|��|r(tj
|���d���SiS)zy
        Read input data and return decoded json
        :param fileio: a file-like object providing read method
        z[%s] I received %i bytesz[%s] payload: %sF)�strict)�read�MAX_MSG_SIZEr�inforrYrL�encoder(rd�loads�strip)rrmrBs   rr^zSimpleAgent.read_input�s���
�{�{�<�(�(������3�'�)�)�.��D�K�K�M�M�0B�0B�	D�	D�	D�����,�(�*�*�/��	7�	7�	7��	��:�d�j�j�l�l�5�9�9�9�9��Ir)r#N)r*r3r#N)rb�
__module__�__qualname__�__doc__rrr�	frozensetrHrM�re�compilerN�staticmethodrQrA�classmethodrErPrSr'r^�rrr
r
&s�����������+�+�+�=�=�=�=�!�y�"�"�"�����O��b�j�?�@�@�G���/��c�����\���!�4�!�D�!�!�!��[�!�F%�%�%�%�N
��
�4�
�
�
�
�
�
rr
)rxrrdrrz�socketr7r:�concurrent.futuresr�	threadingr�internal.constantsr�internal.exceptionsr�internal.utilsr�modules.processorr	rrqr\r
r~rr�<module>r�s�����
�
�
���������	�	�	�	�����
�
�
�
�1�1�1�1�1�1�$�$�$�$�$�$�*�*�*�*�*�*�)�)�)�)�)�)�)�)�)�)�)�)�/�/�/�/�/�/���
����M�M�M�M�M�M�M�M�M�Mr

Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
19 May 2026 8.30 AM
root / root
0755
__init__.cpython-311.pyc
0.172 KB
19 May 2026 8.30 AM
root / root
0644
agent.cpython-311.pyc
9.986 KB
19 May 2026 8.30 AM
root / root
0644
clos_ssa_ini.cpython-311.pyc
1.884 KB
19 May 2026 8.30 AM
root / root
0644
db.cpython-311.pyc
13.585 KB
19 May 2026 8.30 AM
root / root
0644
manager.cpython-311.pyc
27.849 KB
19 May 2026 8.30 AM
root / root
0644
website_isolation.cpython-311.pyc
11.727 KB
19 May 2026 8.30 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF