Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/connection.cpython-311.pyc
�

�,ds{���gd�ZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZm
Z
ddlmZejZ	ddlZddlmZmZmZmZn#e$rejdkr�dZYnwxYwd	Zd
Zej��ZdZdgZeed��rdZedgz
Zejdkrd
Zed
gz
Zefd�Z d�Z!d�Z"d�Z#d�Z$Gd�d��Z%erGd�de%��Z&Gd�de%��Z'Gd�de(��Z)d<d�Z*ejdkrd=d�Z+nd=d�Z+Gd�d e(��Z,d!�Z-ejdkrGd"�d#e(��Z.d$�Z/d%Z0d&Z1d'Z2d(Z3d)�Z4d*�Z5Gd+�d,e(��Z6d-�Z7d.�Z8Gd/�d0e)��Z9d1�Z:ejdkrd2�Z;ej<ej=hZ>d>d3�Z?n#ddl@Z@ee@d4��re@jAZBne@jCZBd>d5�Z?ejdkr0d6�ZDd7�ZEejFe'eD��d8�ZGd9�ZHejFe&eG��dSd:�ZDd;�ZEejFe'eD��dS)?)�Client�Listener�Pipe�wait�N�)�util)�AuthenticationError�BufferTooShort)�	reduction)�
WAIT_OBJECT_0�WAIT_ABANDONED_0�WAIT_TIMEOUT�INFINITE�win32i g4@�AF_INET�AF_UNIX�AF_PIPEc�.�tj��|zS�N��time�	monotonic)�timeouts �A/opt/alt/python311/lib64/python3.11/multiprocessing/connection.py�
_init_timeoutr;s���>���g�%�%�c�0�tj��|kSrr)�ts r�_check_timeoutr>s���>���a��rc��|dkrdS|dkr'tjdtj�����S|dkr>tjdt	j��t
t��fzd���Std	���)
z?
    Return an arbitrary free address for the given family
    r)�	localhostrrz	listener-)�prefix�dirrz\\.\pipe\pyc-%d-%d-�zunrecognized family)	�tempfile�mktempr�get_temp_dir�os�getpid�next�
_mmap_counter�
ValueError��familys r�arbitrary_addressr/Es���������	�9�	�	���k�t�7H�7J�7J�K�K�K�K�	�9�	�	���&<� "�	���T�-�-@�-@�A�'B�GI�K�K�K�	K��.�/�/�/rc���tjdkr|dkrtd|z���tjdkr-|dkr)tt|��std|z���dSdSdS)zD
    Checks if the family is valid for the current environment.
    rrzFamily %s is not recognized.rN)�sys�platformr,�hasattr�socketr-s r�_validate_familyr5Ss����|�w���6�Y�#6�#6��7�&�@�A�A�A�
�|�w���6�Y�#6�#6��v�v�&�&�	F��;�f�D�E�E�E���#6�#6�	F�	Frc��t|��tkrdSt|��tur|�d��rdSt|��tust	j|��rdSt
d|z���)z]
    Return the types of the address

    This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
    rz\\rrzaddress type of %r unrecognized)�type�tuple�str�
startswithr�is_abstract_socket_namespacer,)�addresss r�address_typer=_s}���G�}�}�����y�	
�g���#�	�	�'�"4�"4�V�"<�"<�	��y�	
�g���#�	�	��!B�7�!K�!K�	��y��:�W�D�E�E�Erc��eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	e
d	���Ze
d
���Ze
d���Z
d�Zd
�Zdd�Zd�Zdd�Zdd�Zd�Zdd�Zd�Zd�ZdS)�_ConnectionBaseNTc��|���}|dkrtd���|s|std���||_||_||_dS)Nrzinvalid handlez6at least one of `readable` and `writable` must be True)�	__index__r,�_handle�	_readable�	_writable)�self�handle�readable�writables    r�__init__z_ConnectionBase.__init__usm���!�!�#�#���A�:�:��-�.�.�.��	J��	J��H�J�J�
J����!���!����rc�@�|j�|���dSdSr�rB�_close�rEs r�__del__z_ConnectionBase.__del__�s#���<�#��K�K�M�M�M�M�M�$�#rc�2�|j�td���dS)Nzhandle is closed)rB�OSErrorrMs r�
_check_closedz_ConnectionBase._check_closed�s!���<���,�-�-�-� �rc�2�|jstd���dS)Nzconnection is write-only)rCrPrMs r�_check_readablez_ConnectionBase._check_readable�s%���~�	6��4�5�5�5�	6�	6rc�2�|jstd���dS)Nzconnection is read-only)rDrPrMs r�_check_writablez_ConnectionBase._check_writable�s%���~�	5��3�4�4�4�	5�	5rc�f�|jrd|_n|���td���)NFzbad message length)rDrC�closerPrMs r�_bad_message_lengthz#_ConnectionBase._bad_message_length�s1���>�	�"�D�N�N��J�J�L�L�L��*�+�+�+rc��|jduS)z True if the connection is closedN�rBrMs r�closedz_ConnectionBase.closed�s���|�t�#�#rc��|jS)z"True if the connection is readable)rCrMs rrGz_ConnectionBase.readable�����~�rc��|jS)z"True if the connection is writable)rDrMs rrHz_ConnectionBase.writable�r]rc�8�|���|jS)z+File descriptor or handle of the connection)rQrBrMs r�filenoz_ConnectionBase.fileno�s���������|�rc�h�|j�*	|���d|_dS#d|_wxYwdS)zClose the connectionNrKrMs rrWz_ConnectionBase.close�sB���<�#�
$����
�
�
�#������t���#�#�#�#�	$�#s�&�	/rc��|���|���t|��}|jdkr|�d��}|j}|dkrt
d���||krt
d���|�||z
}n-|dkrt
d���||z|krt
d���|�||||z���dS)	z,Send the bytes data from a bytes-like objectr�Brzoffset is negativezbuffer length < offsetNzsize is negativezbuffer length < offset + size)rQrU�
memoryview�itemsize�cast�nbytesr,�_send_bytes)rE�buf�offset�size�m�ns      r�
send_bytesz_ConnectionBase.send_bytes�s����������������s�O�O���:��>�>����s���A�
�H���A�:�:��1�2�2�2��v�:�:��5�6�6�6��<��v�:�D�D�
�A�X�X��/�0�0�0�
�d�]�Q�
�
��<�=�=�=�����6�&�4�-�/�0�1�1�1�1�1rc��|���|���|�t�|����dS)zSend a (picklable) objectN)rQrUrh�_ForkingPickler�dumps�rE�objs  r�sendz_ConnectionBase.send�sN������������������.�.�s�3�3�4�4�4�4�4rc��|���|���|�|dkrtd���|�|��}|�|���|���S)z7
        Receive bytes data as a bytes object.
        Nrznegative maxlength)rQrSr,�_recv_bytesrX�getvalue)rE�	maxlengthris   r�
recv_bytesz_ConnectionBase.recv_bytes�s}��	
������������� �Y��]�]��1�2�2�2����y�)�)���;��$�$�&�&�&��|�|�~�~�rc�H�|���|���t|��5}|j}|t	|��z}|dkrtd���||krtd���|���}|���}|||zkr!t|�	�����|�
d��|�|||z||z|z���|cddd��S#1swxYwYdS)zq
        Receive bytes data into a writeable bytes-like object.
        Return the number of bytes read.
        rznegative offsetzoffset too largeN)rQrSrdre�lenr,rv�tellr
rw�seek�readinto)rErirjrlre�bytesize�resultrks        r�recv_bytes_intoz_ConnectionBase.recv_bytes_into�sj��
	
������������
��_�_�	���z�H��#�a�&�&�(�H���z�z� �!2�3�3�3��(�"�"� �!3�4�4�4��%�%�'�'�F��;�;�=�=�D��&�4�-�'�'�$�V�_�_�%6�%6�7�7�7��K�K��N�N�N��O�O�A�f��0�%��}��9�:�;�
<�
<�
<��!	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�CD�D�Dc���|���|���|���}t�|�����S)zReceive a (picklable) object)rQrSrvrp�loads�	getbuffer)rEris  r�recvz_ConnectionBase.recv�sS����������������� � ���$�$�S�]�]�_�_�5�5�5r�c�|�|���|���|�|��S)z/Whether there is any input available to be read)rQrS�_poll�rErs  r�pollz_ConnectionBase.poll�s8���������������z�z�'�"�"�"rc��|Sr�rMs r�	__enter__z_ConnectionBase.__enter__����rc�.�|���dSr�rW�rE�exc_type�	exc_value�exc_tbs    r�__exit__z_ConnectionBase.__exit__����
�
�����r)TT)rNr)r)r�)�__name__�
__module__�__qualname__rBrIrNrQrSrUrX�propertyr[rGrHr`rWrnrtryr�r�r�r�r�r�rrr?r?rss�������G�	"�	"�	"�	"����.�.�.�6�6�6�5�5�5�,�,�,��$�$��X�$�����X������X�����
$�$�$�2�2�2�2�(5�5�5���������26�6�6�#�#�#�#��������rr?c�D�eZdZdZdZejfd�Zd�Zd	d�Z	d�Z
d�ZdS)
�PipeConnectionz�
        Connection class based on a Windows named pipe.
        Overlapped I/O is used, so the handles must have been created
        with FILE_FLAG_OVERLAPPED.
        Fc�&�||j��dSrrZ)rE�_CloseHandles  rrLzPipeConnection._closes���L���&�&�&�&�&rc��tj|j|d���\}}	|tjkr.tj|jgdt��}|tksJ�n#|����xYw|�	d��\}}n#|�	d��\}}wxYw|dksJ�|t|��ksJ�dS)NT��
overlappedFr)�_winapi�	WriteFilerB�ERROR_IO_PENDING�WaitForMultipleObjects�eventrr�cancel�GetOverlappedResultr{)rEri�ov�err�waitres�nwrittens      rrhzPipeConnection._send_bytess����'���c�d�K�K�K�G�B��	
=��'�2�2�2�%�<���
�E�8�5�5�G�"�m�3�3�3�3���
��	�	�������� "� 6� 6�t� <� <�
��#�#��� 6� 6�t� <� <�
��#�<�<�<�<��!�8�8�8�8��s�3�x�x�'�'�'�'�'�'s�>A �B� A7�7B�B-Nc��|jrd|_tj��S|�dnt|d��}	t	j|j|d���\}}	|tjkr.t	j|j	gdt��}|tksJ�n#|����xYw|�
d��\}}|dkr<tj��}|�|�����|S|tjkr|�||��Sn�#|�
d��\}}|dkr@tj��}|�|�����|ccYS|tjkr|�||��ccYSwxYwn/#t$$r"}|jtjkrt*��d}~wwxYwt-d���)NF�Tr�rz.shouldn't get here; expected KeyboardInterrupt)�_got_empty_message�io�BytesIO�minr��ReadFilerBr�r�r�rrr�r��writer��ERROR_MORE_DATA�_get_more_datarP�winerror�ERROR_BROKEN_PIPE�EOFError�RuntimeError)	rE�maxsize�bsizer�r�r��nread�f�es	         rrvzPipeConnection._recv_bytes%s���&�
�*/��'��z�|�|�#�&����C���4E�4E���%�.�t�|�U�;?�A�A�A�G�B��D��'�":�:�:�&-�&D�!#��
�E�8�'=�'=�G�#*�m�#;�#;�#;�#;�����	�	��������%'�%;�%;�D�%A�%A�
��s��!�8�8� "�
���A��G�G�B�L�L�N�N�3�3�3�#$�H� �G�$;�;�;�#'�#6�#6�r�7�#C�#C�C�<��&(�%;�%;�D�%A�%A�
��s��!�8�8� "�
���A��G�G�B�L�L�N�N�3�3�3�#$�H�H�H�H�H� �G�$;�;�;�#'�#6�#6�r�7�#C�#C�C�C�C�C�C�C�C�C�C�<�������z�W�%>�>�>�&�������	����
�O�P�P�Psg�F?�>B�D1�B-�-D1�0AF?�
%F?�0F?�1AF;�F?�(F;�8F?�:F;�;F?�?
G+�	G&�&G+c��|js#tj|j��ddkrdSt	t|g|����S)NrT)r�r��
PeekNamedPiperB�boolrr�s  rr�zPipeConnection._pollEsI���'�
��-�d�l�;�;�A�>�!�C�C��t���d�V�W�-�-�.�.�.rc��|���}tj��}|�|��t	j|j��d}|dksJ�|�*t|��|z|kr|���t	j	|j|d���\}}|�
d��\}}|dksJ�||ksJ�|�|�����|S)NrrTr�)r�r�r�r�r�r�rBr{rXr�r�)rEr�r�rir��leftr��rbytess        rr�zPipeConnection._get_more_dataKs����,�,�.�.�C��
���A�
�G�G�C�L�L�L��(���6�6�q�9�D��!�8�8�8�8��"�s�3�x�x�$���'@�'@��(�(�*�*�*��&�t�|�T�d�K�K�K�G�B���0�0��6�6�K�F�C��!�8�8�8�8��T�>�>�>�>�
�G�G�B�L�L�N�N�#�#�#��Hrr)r�r�r��__doc__r�r��CloseHandlerLrhrvr�r�r�rrr�r�s�������	�	�
#��&-�&9�	'�	'�	'�	'�
	(�
	(�
	(�	Q�	Q�	Q�	Q�@	/�	/�	/�
	�
	�
	�
	�
	rr�c��eZdZdZerejfd�ZejZ	ej
Znej
fd�ZejZ	ejZe	fd�Zefd�Zd�Zd
d�Zd	�ZdS)�
Connectionzo
    Connection class based on an arbitrary file descriptor (Unix only), or
    a socket handle (Windows).
    c�&�||j��dSrrZ�rErLs  rrLzConnection._closeb����F�4�<� � � � � rc�&�||j��dSrrZr�s  rrLzConnection._closegr�rc�t�t|��}	||j|��}||z}|dkrdS||d�}�))NTr)r{rB)rErir��	remainingrms     r�_sendzConnection._sendlsN����H�H�	�	���d�l�C�(�(�A���N�I��A�~�~����a�b�b�'�C�	rc��tj��}|j}|}|dkr]|||��}t|��}|dkr||krt�td���|�|��||z}|dk�]|S)Nrzgot end of file during message)r�r�rBr{r�rPr�)rErk�readrirFr��chunkrms        r�_recvzConnection._recvus����j�l�l������	��!�m�m��D���+�+�E��E�
�
�A��A�v�v���$�$�"�N�!�"B�C�C�C��I�I�e������N�I��!�m�m��
rc���t|��}|dkrktjdd��}tjd|��}|�|��|�|��|�|��dStjd|��}|dkr,|�|��|�|��dS|�||z��dS)Ni����!i����!Qi@)r{�struct�packr�)rErirm�
pre_header�headers     rrhzConnection._send_bytes�s�����H�H���z�>�>���T�2�.�.�J��[��q�)�)�F��J�J�z�"�"�"��J�J�v�����J�J�s�O�O�O�O�O��[��q�)�)�F��5�y�y��
�
�6�"�"�"��
�
�3�������
�
�6�C�<�(�(�(�(�(rNc�D�|�d��}tjd|�����\}|dkr>|�d��}tjd|�����\}|�||krdS|�|��S)N�r�r��r�)r�r��unpackrw)rEr�rirks    rrvzConnection._recv_bytes�s����j�j��m�m���
�d�C�L�L�N�N�3�3����2�:�:��*�*�Q�-�-�C��M�$������7�7�E�D���4�'�>�>��4��z�z�$���rc�B�t|g|��}t|��Sr)rr�)rEr�rs   rr�zConnection._poll�s���$���!�!���A�w�w�rr)r�r�r�r�r��_multiprocessing�closesocketrLrt�_writer��_readr(rWr�r�r�r�rhrvr�r�rrr�r�[s���������
�	� 0� <�	!�	!�	!�	!�!�&�� �%��� "��	!�	!�	!�	!�������%����� %����� )�)�)�. � � � �����rr�c�^�eZdZdZdd�Zd�Zd�Zed���Zed���Z	d	�Z
d
�ZdS)rz�
    Returns a listener object.

    This is a wrapper for a bound socket which is 'listening' for
    connections, or for a Windows named pipe.
    Nrc�8�|p|rt|��pt}|pt|��}t|��|dkrt	||��|_nt
|||��|_|�$t|t��std���||_
dS)Nr�authkey should be a byte string)r=�default_familyr/r5�PipeListener�	_listener�SocketListener�
isinstance�bytes�	TypeError�_authkey)rEr<r.�backlog�authkeys     rrIzListener.__init__�s����#�G�=��W�(=�(=�#�"�	��6�.�v�6�6���� � � ��Y���)�'�7�;�;�D�N�N�+�G�V�W�E�E�D�N���z�'�5�'A�'A���=�>�>�>���
�
�
rc���|j�td���|j���}|jr*t	||j��t||j��|S)zz
        Accept a connection on the bound socket or named pipe of `self`.

        Returns a `Connection` object.
        Nzlistener is closed)r�rP�acceptr��deliver_challenge�answer_challenge)rE�cs  rr�zListener.accept�sa���>�!��.�/�/�/��N�!�!�#�#���=�	/��a���/�/�/��Q��
�.�.�.��rc�R�|j}|�d|_|���dSdS)zA
        Close the bound socket or named pipe of `self`.
        N)r�rW)rE�listeners  rrWzListener.close�s6���>����!�D�N��N�N������ �rc��|jjSr)r��_addressrMs rr<zListener.address�s
���~�&�&rc��|jjSr)r��_last_acceptedrMs r�
last_acceptedzListener.last_accepted�s
���~�,�,rc��|Srr�rMs rr�zListener.__enter__�r�rc�.�|���dSrr�r�s    rr�zListener.__exit__�r�r)NNrN)r�r�r�r�rIr�rWr�r<r�r�r�r�rrrr�s��������� � � � � �������'�'��X�'��-�-��X�-��������rrc� �|pt|��}t|��|dkrt|��}nt|��}|�$t	|t
��st
d���|� t||��t||��|S)z=
    Returns a connection to the address of a `Listener`
    rNr�)	r=r5�
PipeClient�SocketClientr�r�r�r�r�)r<r.r�r�s    rrr�s����
,�|�G�,�,�F��V����
�����w�������!�!����:�g�u�#=�#=���9�:�:�:�����G�$�$�$��!�W�%�%�%��HrTc��|r�tj��\}}|�d��|�d��t|�����}t|�����}n8tj��\}}t|d���}t|d���}||fS)�L
        Returns pair of connection objects at either end of a pipe
        TF�rH�rG)r4�
socketpair�setblockingr��detachr(�pipe)�duplex�s1�s2�c1�c2�fd1�fd2s       rrrs����		1��&�(�(�F�B���N�N�4� � � ��N�N�4� � � ��B�I�I�K�K�(�(�B��B�I�I�K�K�(�(�B�B��w�y�y�H�C���C�%�0�0�0�B��C�%�0�0�0�B��2�v�
rc
�&�td��}|r4tj}tjtjz}t
t
}}n!tj}tj}dt
}}tj||tjztj	ztj
tjztjzd||tj
tj��}tj||dtjtjtjtj��}tj|tjdd��tj|d���}|�d��\}	}
|
dksJ�t)||���}t)||���}||fS)	rrrrNTr�rr)r/r��PIPE_ACCESS_DUPLEX�GENERIC_READ�
GENERIC_WRITE�BUFSIZE�PIPE_ACCESS_INBOUND�CreateNamedPipe�FILE_FLAG_OVERLAPPED�FILE_FLAG_FIRST_PIPE_INSTANCE�PIPE_TYPE_MESSAGE�PIPE_READMODE_MESSAGE�	PIPE_WAIT�NMPWAIT_WAIT_FOREVER�NULL�
CreateFile�
OPEN_EXISTING�SetNamedPipeHandleState�ConnectNamedPiper�r�)
r
r<�openmode�access�obsize�ibsize�h1�h2r��_r�rrs
             rrrsb��$�I�.�.���	(��1�H��)�G�,A�A�F�$�g�F�F�F��2�H��*�F���F�F�
�
$��X�� <�<��1�2��%��(E�E���
�
�v�v�w�;��L�����
��V�Q���g�.C��(�'�,����	�'���-�t�T�	�	�	��-�b�T�B�B�B�
��/�/��5�5���3��a�x�x�x�x�
�B��
0�
0�
0��
�B��
0�
0�
0���2�v�
rc�&�eZdZdZdd�Zd�Zd�ZdS)r�zO
    Representation of a socket which is bound to an address and listening
    rc��tjtt|����|_	tjdkr0|j�tjtjd��|j�d��|j�	|��|j�
|��|j���|_n(#t$r|j����wxYw||_d|_|dkr>t#j|��s*t#j|tj|fd���|_dSd|_dS)N�posixrTrr��args�exitpriority)r4�getattr�_socketr(�name�
setsockopt�
SOL_SOCKET�SO_REUSEADDRr
�bind�listen�getsocknamer�rPrW�_familyr�rr;�Finalize�unlink�_unlink)rEr<r.r�s    rrIzSocketListener.__init__FsF���}�W�V�V�%<�%<�=�=���	��w�'�!�!���'�'��(9�(.�(;�Q�@�@�@��L�$�$�T�*�*�*��L���g�&�&�&��L����(�(�(� �L�4�4�6�6�D�M�M���	�	�	��L��� � � ��	�������"����Y���t�'H��'Q�'Q���=��b�i�w�j�q����D�L�L�L� �D�L�L�Ls�B,C�%Dc��|j���\}|_|�d��t	|�����S)NT)r4r�r�r
r�r�rE�ss  rr�zSocketListener.accept_sE��!%��!4�!4�!6�!6���4��	�
�
�d�����!�(�(�*�*�%�%�%rc��	|j���|j}|�d|_|��dSdS#|j}|�d|_|��wwxYwr)r4rWr?)rEr>s  rrWzSocketListener.closedsr��	��L��� � � ��\�F��!�#����������"�!���\�F��!�#���������"���s	�9�AN)r)r�r�r�r�rIr�rWr�rrr�r�BsP�������� � � � �2&�&�&�
����rr�c�8�t|��}tjtt|����5}|�d��|�|��t|�����cddd��S#1swxYwYdS)zO
    Return a connection object connected to the socket given by `address`
    TN)r=r4r3r
�connectr�r)r<r.rBs   rrrns����'�
"�
"�F�	�����/�/�	1�	1�&�Q�	�
�
�d����	�	�	�'�����!�(�(�*�*�%�%�&�&�&�&�&�&�&�&�&�&�&�&����&�&�&�&�&�&s�AB�B�Bc�>�eZdZdZdd�Zd	d�Zd�Zed���ZdS)
r�z0
        Representation of a named pipe
        Nc���||_|�d���g|_d|_t	jd|j��t	j|tj|j|jfd���|_	dS)NT)�firstz listener created with address=%rrr0)
r��_new_handle�
_handle_queuer�r�	sub_debugr=r��_finalize_pipe_listenerrW)rEr<r�s   rrIzPipeListener.__init__�su��#�D�M�"&�"2�"2��"2�">�">�!?�D��"&�D���N�=�t�}�M�M�M����l�:��(�$�-�8�q����D�J�J�JrFc
�.�tjtjz}|r|tjz}tj|j|tjtjztjztj	tttjtj��Sr)
r�rrrrr�rrr�PIPE_UNLIMITED_INSTANCESrr r!)rErH�flagss   rrIzPipeListener._new_handle�sp���.��1M�M�E��
?���>�>���*��
�u��)�G�,I�I��!�"��0�'�7��,�g�l���
rc�d�|j�|�����|j�d��}	t	j|d���}	t	j|jgdt��}n.#|�	��t	j
|���xYw	|�d��\}}|dksJ�nR#|�d��\}}|dksJ�wxYw#t$r }|j
tjkr�Yd}~nd}~wwxYwt|��S)NrTr�F)rJ�appendrI�popr�r%r�r�rr�r�r�rPr��
ERROR_NO_DATAr�)rErFr��resr,r�r�s       rr�zPipeListener.accept�sT����%�%�d�&6�&6�&8�&8�9�9�9��'�+�+�A�.�.�F�
$��-�f��F�F�F��	$�!�8���
�E�8�5�5�C�C����I�I�K�K�K��'��/�/�/������ �3�3�D�9�9�F�A�s��!�8�8�8�8�8�� �3�3�D�9�9�F�A�s��!�8�8�8�8�8�8�8�8���
�
�
��:��!6�6�6��7�6�6�6�6�����
���� "�&�)�)�)s6�C6�!B�C�+B,�,C�"C3�6
D �D�D c�b�tjd|��|D]}tj|���dS)Nz closing listener with address=%r)rrKr�r�)�queuer<rFs   rrLz$PipeListener._finalize_pipe_listener�sB���N�=�w�G�G�G��
,�
,���#�F�+�+�+�+�
,�
,rr)F)	r�r�r�r�rIrIr��staticmethodrLr�rrr�r�~sp������	�	�		�		�		�		�
	�
	�
	�
	�	*�	*�	*�.
�	,�	,�
��	,�	,�	,rr�c	���t��}		tj|d��tj|tjtjzdtjtjtjtj��}nG#t$r9}|j
tjtjfvst|��r�Yd}~nd}~wwxYw��tj|tjdd��t!|��S)zU
        Return a connection object connected to the pipe given by `address`
        r��rN)rr��
WaitNamedPiper"rrr!r#rrPr��ERROR_SEM_TIMEOUT�ERROR_PIPE_BUSYrr$rr�)r<r�hr�s    rrr�s��
�O�O��	�
��%�g�t�4�4�4��&��W�1�G�4I�I��w�|�W�%:��0�'�,�������
�
�
��:�g�&?�&-�&=�&?�?�?�BP�QR�BS�BS�?��?�?�?�?�?�����
����	�"	�'�
�w�,�d�D�	�	�	��a� � � s�A.B�
C�
/B>�>C�s#CHALLENGE#s	#WELCOME#s	#FAILURE#c��ddl}t|t��s/td�t|�������t
jt��}|�	t|z��|�||d�����}|�
d��}||kr|�	t��dS|�	t��t!d���)Nr� Authkey must be bytes, not {0!s}�md5�zdigest received was wrong)�hmacr�r�r,�formatr7r(�urandom�MESSAGE_LENGTHrn�	CHALLENGE�new�digestry�WELCOME�FAILUREr	��
connectionr�rc�messageri�responses      rr�r��s����K�K�K��g�u�%�%�F��.�5�5�d�7�m�m�D�D�F�F�	F��j��(�(�G����)�g�-�.�.�.�
�X�X�g�w��
.�
.�
5�
5�
7�
7�F��$�$�S�)�)�H��6������g�&�&�&�&�&����g�&�&�&�!�"=�>�>�>rc�6�ddl}t|t��s/td�t|�������|�d��}|dtt���tks
Jd|z���|tt��d�}|�	||d���
��}|�|��|�d��}|tkrtd���dS)Nrr`rbzmessage = %rrazdigest sent was rejected)rcr�r�r,rdr7ryr{rgrhrirnrjr	rls      rr�r��s���K�K�K��g�u�%�%�F��.�5�5�d�7�m�m�D�D�F�F�	F��#�#�C�(�(�G��?�C�	�N�N�?�#�y�0�0�0�.�7�2J�0�0�0��c�)�n�n�o�o�&�G�
�X�X�g�w��
.�
.�
5�
5�
7�
7�F����&�!�!�!��$�$�S�)�)�H��7���!�"<�=�=�=��rc� �eZdZd�Zd�Zd�ZdS)�ConnectionWrapperc�|�||_||_||_dD]#}t||��}t	|||���$dS)N)r`rWr�ryrn)�_conn�_dumps�_loadsr3�setattr)rE�connrqr��attrrss      rrIzConnectionWrapper.__init__�sT����
�������K�	%�	%�D��$��%�%�C��D�$��$�$�$�$�	%�	%rc�d�|�|��}|j�|��dSr)rurtrn)rErsrBs   rrtzConnectionWrapper.sends/���K�K������
���a� � � � � rc�^�|j���}|�|��Sr)rtryrvrAs  rr�zConnectionWrapper.recvs%���J�!�!�#�#���{�{�1�~�~�rN)r�r�r�rIrtr�r�rrrrrr�sA������%�%�%�!�!�!�����rrrc�f�t�|fdddd���d��S)Nr�utf-8)�	xmlrpclibrq�encode)rss r�
_xml_dumpsr�s,���?�?�C�6�4��t�Q�7�7�>�>�w�G�G�Grc�j�t�|�d����\\}}|S)Nr})r~r��decode)rBrs�methods   r�
_xml_loadsr�s*���_�_�Q�X�X�g�%6�%6�7�7�N�F�S�F��Jrc��eZdZd�ZdS)�XmlListenerc�x�ddlmat�|��}t|tt��S�Nr)�
xmlrpc.client�clientr~rr�rrr�r�rrs  rr�zXmlListener.accepts7��)�)�)�)�)�)��o�o�d�#�#�� ��j�*�=�=�=rN)r�r�r�r�r�rrr�r�s#������>�>�>�>�>rr�c�X�ddlmatt	|i|��t
t��Sr�)r�r�r~rrrr�r�)r1�kwdss  r�	XmlClientr�s3��%�%�%�%�%�%��V�T�2�T�2�2�J�
�K�K�Krc��t|��}g}|r�tj|d|��}|tkrn�t|cxkrtt|��zkrnn|tz}nDt|cxkrtt|��zkrnn|tz}ntd���|�||��||dzd�}d}|��|S)NFzShould not get hererr)	�listr�r�rrr{r
r�rQ)�handlesr�L�readyrTs     r�_exhaustive_waitr�$s���
��M�M�����	��0��E�7�C�C�C��l�"�"���#�>�>�>�>�
��A���(>�>�>�>�>�>��}�$���!�S�D�D�D�D�+;�c�!�f�f�+D�D�D�D�D�D��'�'���"�#8�9�9�9��L�L��3�� � � ��#�a�%�&�&�	�A��G��	��rc��
��|�t}n|dkrd}nt|dzdz��}t|��}i�g}t���
t��}	|D�]B}	t	|d��}	tj|��dd��\}}n*#t$r}d|j}}|tvr�Yd}~nd}~wwxYw|t
j
kr |�|��|�|j<��|rptj��dd�dkrQ	|�d	��\}	}n#t$r}|j}Yd}~nd}~wwxYw|st!|d
��rd|_�
�|��d}��#t&$r|�|���<Y��@wxYwt+����|��}|D]}|����|D]�}	|�d��\}	}n(#t$r}|j}|tvr�Yd}~nd}~wwxYw|t
jkr?�|j}�
�|��|dkrt!|d
��rd|_��n�#|D]}|����|D]�}	|�d��\}	}n(#t$r}|j}|tvr�Yd}~nd}~wwxYw|t
jkr?�|j}�
�|��|dkrt!|d
��rd|_��wxYw�
��fd�|D�����
fd�|D��S)
��
        Wait till an object in object_list is ready/readable.

        Returns list of those objects in object_list which are ready/readable.
        NrrYg�?r`T�)�r�Fr�c3�(�K�|]}�|V��
dSrr�)�.0r]�waithandle_to_objs  �r�	<genexpr>zwait.<locals>.<genexpr>�s)�����I�I�a�.�q�1�I�I�I�I�I�Irc���g|]}|�v�|��	Sr�r�)r��o�
ready_objectss  �r�
<listcomp>zwait.<locals>.<listcomp>�s#���=�=�=�a�!�}�*<�*<��*<�*<�*<r)r�intr��setr3r�r�rPr��
_ready_errorsr�rQr�r1�getwindowsversionr�r3r��add�AttributeErrorrAr��keysr��ERROR_OPERATION_ABORTED�update)�object_listr�ov_list�
ready_handlesr�r`r�r�r�r,r�r�s          @@rrr:sX�����?��G�G�
�q�[�[��G�G��'�D�.�3�.�/�/�G��;�'�'���������
����
�6	8� �
$�
$��$�$�Q��1�1�F�
"�")�"2�6�6�8�8�Q��"E�"E���C�C��"�"�"�"�"&��
�C���m�3�3�!�4�3�3�3�3�����"�����g�6�6�6����r�*�*�*�67�)�"�(�3�3�
�<�#�"7�"9�"9�"�1�"�"=��"G�"G�1�)+�)?�)?��)F�)F���3�3��#*�1�1�1�&'�j�����������1����#&�<�7�1�6J�+K�+K�<�7;�� 4�%�)�)�!�,�,�,�"#����7&�9�9�9�78�%�a�k�k�m�m�4�4�4�9����:-�->�-C�-C�-E�-E�w�O�O�M��
�
���	�	������
8�
8����3�3�D�9�9�F�A�s�s�������*�C��-�/�/��0�/�/�/�/����������'�9�9�9�)�"�(�3�A�!�%�%�a�(�(�(��a�x�x�#�1�&:�;�;�8�37�A�0��
8��	�
�
���	�	������
8�
8����3�3�D�9�9�F�A�s�s�������*�C��-�/�/��0�/�/�/�/����������'�9�9�9�)�"�(�3�A�!�%�%�a�(�(�(��a�x�x�#�1�&:�;�;�8�37�A�0��
8���� 	���I�I�I�I�=�I�I�I�I�I�I�=�=�=�=�;�=�=�=�=s��I3�!E9�2!B�I3�
B;�B6�1I3�6B;�;AI3�D)�(I3�)
E�3D?�:I3�?E�5I3�9!F�I3�F�%I3�!G:�:
H�H�H�3L$�J+�*L$�+
K	�5K	�L$�K	�AL$�PollSelectorc�n�t��5}|D]"}|�|tj���#|�t	j��|z}	|�|��}|rd�|D��cddd��S|�*|t	j��z
}|dkr|cddd��S�\#1swxYwYdS)r�NTc�"�g|]\}}|j��
Sr�)�fileobj)r��key�eventss   rr�zwait.<locals>.<listcomp>�s��C�C�C�M�S�&�C�K�C�C�Crr)�
_WaitSelector�register�	selectors�
EVENT_READrr�select)r�r�selectorrs�deadliner�s      rrr�s4���_�_�	)��"�
=�
=���!�!�#�y�';�<�<�<�<��"��>�+�+�g�5��
)� ����0�0���)�C�C�U�C�C�C�	)�	)�	)�	)�	)�	)�	)�	)��*�"*�T�^�-=�-=�"=��"�Q�;�;�#(�	)�	)�	)�	)�	)�	)�	)�	)�
)�	)�	)�	)�	)����	)�	)�	)�	)�	)�	)s�A!B*�=B*�)B*�*B.�1B.c��|���}tj|tjtj��5}ddlm}|�|��}t||j	|j
ffcddd��S#1swxYwYdS)Nr)�resource_sharer)r`r4�fromfdr�SOCK_STREAMr$r��	DupSocket�rebuild_connectionrGrH)rxrFrBr��dss     r�reduce_connectionr��s���������
�]�6�6�>�6�3E�
F�
F�	J�!�)�)�)�)�)�)� �*�*�1�-�-�B�%��D�M�4�=�'I�I�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J����	J�	J�	J�	J�	J�	Js�1A=�=B�Bc�p�|���}t|���||��Sr�rr�)r�rGrH�socks    rr�r��s)���y�y�{�{���$�+�+�-�-��8�<�<�<rc���|jrtjnd|jrtjndz}tj|���|��}t||j|jffSr�)	rGr��FILE_GENERIC_READrH�FILE_GENERIC_WRITEr�	DupHandler`�rebuild_pipe_connection)rxr'�dhs   r�reduce_pipe_connectionr��s^��04�
�D�7�,�,�1�15��E�7�-�-�A�G��
�
 �������
7�
7��&��T�]�D�M�(J�J�Jrc�L�|���}t|||��Sr)rr�)r�rGrHrFs    rr�r��s!���������f�h��9�9�9rc�z�tj|�����}t||j|jffSr)r�DupFdr`r�rGrH)rx�dfs  rr�r��s/��
�_�T�[�[�]�]�
+�
+��!�B��
�t�}�#E�E�Erc�L�|���}t|||��Srr�)r�rGrH�fds    rr�r��s!��
�Y�Y�[�[���"�h��1�1�1r)NN)Tr)I�__all__r�r(r1r4r�rr%�	itertoolsr�r$rr	r
�contextr�ForkingPicklerrpr�rr
rr�ImportErrorr2r�CONNECTION_TIMEOUT�countr+r��familiesr3rrr/r5r=r?r�r��objectrrrr�rr�rrfrgrjrkr�r�rrr�r�r�r�r�r��ERROR_NETNAME_DELETEDr�rr�r�r��SelectSelectorr�r�r�r�r�r�rr�<module>r�s���3�
2�
2��	�	�	�	�	�	�	�	�
�
�
�
�
�
�
�
�
�
�
�
�����������������������1�1�1�1�1�1�1�1��������*����N�N�N�O�O�O�O�O�O�O�O�O�O�O�O�O������
�|�w���
��G�G�G����������	��!�!�
����;��
�7�6�9�����N�����H��<�7����N�����H�-�&�&�&�&� � � �0�0�0�
F�
F�
F�
F�
F�
F�&T�T�T�T�T�T�T�T�n�O�M�M�M�M�M��M�M�M�`M�M�M�M�M��M�M�M�h:�:�:�:�:�v�:�:�:�z
�
�
�
�*�<�7��������&&�&�&�&�X)�)�)�)�)�V�)�)�)�X&�&�&��<�7���6,�6,�6,�6,�6,�v�6,�6,�6,�p!�!�!�>���	�
��
��
?�
?�
?�>�>�>�$
�
�
�
�
��
�
�
�H�H�H����>�>�>�>�>�(�>�>�>�L�L�L��<�7������(�.��0M�N�M�L>�L>�L>�L>�L>�`����
�w�y�.�)�)�1�!�.�
�
�!�0�
�)�)�)�)�6�<�7���J�J�J�=�=�=��I��z�#4�5�5�5�K�K�K�
:�:�:��I��~�'=�>�>�>�>�>�F�F�F�2�2�2��I��z�#4�5�5�5�5�5s�A�A,�+A,

ZeroDay Forums Mini