AlkantarClanX12

Your IP : 18.118.154.237


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

�

c��f�~���gd�ZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
mZddlmZejZ	ddlZddlmZmZmZmZn#e$rejdkr�dZYnwxYwd	Zd
Ze	j��ZdZdgZe ed��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$�Z0d%Z1d&Z2d'Z3d(Z4d)�Z5d*�Z6Gd+�d,e)��Z7d-�Z8d.�Z9Gd/�d0e*��Z:d1�Z;ejdkrd2�Z<ej=ej>hZ?d>d3�Z@n#ddlAZAe eAd4��reAjBZCneAjDZCd>d5�Z@ejdkr0d6�ZEd7�ZFejGe(eE��d8�ZHd9�ZIejGe'eH��dSd:�ZEd;�ZFejGe(eE��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	���)
Nr)�	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/Fs����������	�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)NrrzFamily %s is not recognized.r)�sys�platformr,�hasattr�socketr-s r�_validate_familyr5Ts�����|�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���)Nrz\\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__vsm���!�!�#�#���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)N�handle is closed)rB�OSErrorrMs r�
_check_closedz_ConnectionBase._check_closed�s!���<���,�-�-�-� �rc�2�|jstd���dS)Nzconnection is write-only)rCrQrMs r�_check_readablez_ConnectionBase._check_readable�s%���~�	6��4�5�5�5�	6�	6rc�2�|jstd���dS)Nzconnection is read-only)rDrQrMs r�_check_writablez_ConnectionBase._check_writable�s%���~�	5��3�4�4�4�	5�	5rc�f�|jrd|_n|���td���)NFzbad message length)rDrC�closerQrMs r�_bad_message_lengthz#_ConnectionBase._bad_message_length�s1���>�	�"�D�N�N��J�J�L�L�L��*�+�+�+rc��	|jduSr�rBrMs r�closedz_ConnectionBase.closed�s��.��|�t�#�#rc��	|jSr)rCrMs rrGz_ConnectionBase.readable��
��0��~�rc��	|jSr)rDrMs rrHz_ConnectionBase.writable�r^rc�:�	|���|jSr)rRrBrMs r�filenoz_ConnectionBase.fileno�s��9��������|�rc�j�	|j�*	|���d|_dS#d|_wxYwdSrrKrMs rrXz_ConnectionBase.close�sE��"��<�#�
$����
�
�
�#������t���#�#�#�#�	$�#s�'�	0rc���	|���|���t|��}|jdkr|�d��}|j}|dkrt
d���||krt
d���|�||z
}n-|dkrt
d���||z|krt
d���|�||||z���dS)Nr�Brzoffset is negativezbuffer length < offsetzsize is negativezbuffer length < offset + size)rRrV�
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�|����dSr)rRrVri�_ForkingPickler�dumps�rE�objs  r�sendz_ConnectionBase.send�sQ��'�����������������.�.�s�3�3�4�4�4�4�4rc��	|���|���|�|dkrtd���|�|��}|�|���|���S)Nrznegative maxlength)rRrTr,�_recv_bytesrY�getvalue)rE�	maxlengthrjs   r�
recv_bytesz_ConnectionBase.recv_bytes�s���	�	
������������� �Y��]�]��1�2�2�2����y�)�)���;��$�$�&�&�&��|�|�~�~�rc�J�	|���|���t|��5}|j}|t	|��z}|dkrtd���||krtd���|���}|���}|||zkr!t|�	�����|�
d��|�|||z||z|z���|cddd��S#1swxYwYdS)Nrznegative offsetzoffset too large)rRrTrerf�lenr,rw�tellr
rx�seek�readinto)rErjrkrmrf�bytesize�resultrls        r�recv_bytes_intoz_ConnectionBase.recv_bytes_into�so��	�	
������������
��_�_�	���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�|�����Sr)rRrTrwrq�loads�	getbuffer)rErjs  r�recvz_ConnectionBase.recv�sV��*���������������� � ���$�$�S�]�]�_�_�5�5�5r�c�~�	|���|���|�|��Sr)rRrT�_poll�rErs  r�pollz_ConnectionBase.poll�s;��=��������������z�z�'�"�"�"rc��|Sr�rMs r�	__enter__z_ConnectionBase.__enter__����rc�.�|���dSr�rX�rE�exc_type�	exc_value�exc_tbs    r�__exit__z_ConnectionBase.__exit__����
�
�����r)TT)rNr)r)r�)�__name__�
__module__�__qualname__rBrIrNrRrTrVrY�propertyr\rGrHrarXrorurzr�r�r�r�r�r�rrr?r?sss�������G�	"�	"�	"�	"����.�.�.�6�6�6�5�5�5�,�,�,��$�$��X�$�����X������X�����
$�$�$�2�2�2�2�(5�5�5���������26�6�6�#�#�#�#��������rr?c�F�eZdZ	dZdZejfd�Zd�Zdd�Z	d�Z
d�ZdS)	�PipeConnectionFNc�`�|j}|�|���||j��dSr)�_send_ov�cancelrB)rE�_CloseHandle�ovs   rrLzPipeConnection._closes3����B��~��	�	�����L���&�&�&�&�&rc���|j�td���tj|j|d���\}}||_	|tjkr!tj|jgdt��}n#|�	���xYwd|_|�
d��\}}n$#d|_|�
d��\}}wxYw|tjkrttjd���dS)Nz/concurrent send_bytes() calls are not supportedT��
overlappedFrP)r�r,�_winapi�	WriteFilerB�ERROR_IO_PENDING�WaitForMultipleObjects�eventrr��GetOverlappedResult�ERROR_OPERATION_ABORTEDrQ�errno�EPIPE)rErjr��err�waitres�nwrittens      rrizPipeConnection._send_bytess���}�(� �"5�6�6�6��'���c�d�K�K�K�G�B���D�M�

=��'�2�2�2�%�<���
�E�8�5�5�G���
��	�	�������� $��
� "� 6� 6�t� <� <�
��#�#��!%��
� "� 6� 6�t� <� <�
��#�<�<�<�<��g�5�5�5��e�k�+=�>�>�>�	6�5s�1A0�/B*�0B�B*�*!Cc���|jrd|_tj��S|�dnt|d��}	t	j|j|d���\}}	|tjkr!t	j|j	gdt��}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��writer��ERROR_MORE_DATA�_get_more_datarQ�winerror�ERROR_BROKEN_PIPE�EOFError�RuntimeError)	rE�maxsize�bsizer�r�r��nread�f�es	         rrwzPipeConnection._recv_bytes6s���&�
�*/��'��z�|�|�#�&����C���4E�4E���%�.�t�|�U�;?�A�A�A�G�B��D��'�":�:�:�&-�&D�!#��
�E�8�'=�'=�G�����	�	��������%'�%;�%;�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�F2�1B	�D$�	B � D$�#AF2�=%F2�#F2�$AF.�F2�(F.�+F2�-F.�.F2�2
G�<G�Gc��|js#tj|j��ddkrdSt	t|g|����S)NrT)r�r��
PeekNamedPiperB�boolrr�s  rr�zPipeConnection._pollVsI���'�
��-�d�l�;�;�A�>�!�C�C��t���d�V�W�-�-�.�.�.rc���|���}tj��}|�|��t	j|j��d}|�*t|��|z|kr|���t	j	|j|d���\}}|�
d��\}}|�|�����|S)NrTr�)r�r�r�r�r�r�rBr|rYr�r�)rEr�r�rjr��leftr��rbytess        rr�zPipeConnection._get_more_data\s����,�,�.�.�C��
���A�
�G�G�C�L�L�L��(���6�6�q�9�D��"�s�3�x�x�$���'@�'@��(�(�*�*�*��&�t�|�T�d�K�K�K�G�B���0�0��6�6�K�F�C�
�G�G�B�L�L�N�N�#�#�#��Hrr)r�r�r�r�r�r��CloseHandlerLrirwr�r�r�rrr�r�s�������	�
#����&-�&9�	'�	'�	'�	'�	(�	(�	(�4	Q�	Q�	Q�	Q�@	/�	/�	/�
	�
	�
	�
	�
	rr�c��eZdZ	erejfd�ZejZej	Z
nejfd�Zej
ZejZ
efd�Ze
fd�Zd�Zd	d�Zd�ZdS)
�
Connectionc�&�||j��dSrr[�rErLs  rrLzConnection._closes����F�4�<� � � � � rc�&�||j��dSrr[r�s  rrLzConnection._closexr�rc�t�t|��}	||j|��}||z}|dkrdS||d�}�))NTr)r|rB)rErjr��	remainingrns     r�_sendzConnection._send}sN����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�rQr�)rErl�readrjrFr��chunkrns        r�_recvzConnection._recv�s����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�)rErjrn�
pre_header�headers     rrizConnection._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��unpackrx)rEr�rjrls    rrwzConnection._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��_multiprocessing�closesocketrLru�_writer��_readr(rXr�r�r�r�rirwr�r�rrr�r�ls��������
�	� 0� <�	!�	!�	!�	!�!�&�� �%��� "��	!�	!�	!�	!�������%����� %����� )�)�)�. � � � �����rr�c�\�eZdZ	d
d�Zd�Zd�Zed���Zed���Zd�Z	d	�Z
dS)rNrc�8�|p|rt|��pt}|pt|��}t|��|dkrt	||��|_nt
|||��|_|�$t|t��std���||_
dS�Nrzauthkey 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���}|j�*t	||j��t||j��|S)Nzlistener is closed)r�rQ�acceptr��deliver_challenge�answer_challenge)rE�cs  rr�zListener.accept�sd��	�
�>�!��.�/�/�/��N�!�!�#�#���=�$��a���/�/�/��Q��
�.�.�.��rc�T�	|j}|�d|_|���dSdSr)r�rX)rE�listeners  rrXzListener.close�s;��	��>����!�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�rIr�rXr�r<rr�r�r�rrrr�s�������� � � � � 
�
�
�����'�'��X�'��-�-��X�-��������rrc�"�	|pt|��}t|��|dkrt|��}nt|��}|�$t	|t
��st
d���|� t||��t||��|Sr�)	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)NTF�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��\}	}
t)||���}t)||���}||fS)NrrrTr�r
r)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�)
rr<�openmode�access�obsize�ibsize�h1�h2r��_r�rrs
             rrr(s\��	�$�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��B��
0�
0�
0��
�B��
0�
0�
0���2�v�
rc�$�eZdZ	dd�Zd�Zd�ZdS)r�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�getsocknamerrQrX�_familyrrr;�Finalize�unlink�_unlink)rEr<r.r�s    rrIzSocketListener.__init__XsF���}�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)r7r�rr
r�r�rE�ss  rr�zSocketListener.acceptqsE��!%��!4�!4�!6�!6���4��	�
�
�d�����!�(�(�*�*�%�%�%rc��	|j���|j}|�d|_|��dSdS#|j}|�d|_|��wwxYwr)r7rXrB)rErAs  rrXzSocketListener.closevsr��	��L��� � � ��\�F��!�#����������"�!���\�F��!�#���������"���s	�9�AN)r)r�r�r�rIr�rXr�rrr�r�TsK������� � � � �2&�&�&�
����rr�c�:�	t|��}tjtt|����5}|�d��|�|��t|�����cddd��S#1swxYwYdSrD)r=r4r6r
�connectr�r)r<r.rFs   rrr�s�����'�
"�
"�F�	�����/�/�	1�	1�&�Q�	�
�
�d����	�	�	�'�����!�(�(�*�*�%�%�&�&�&�&�&�&�&�&�&�&�&�&����&�&�&�&�&�&s�AB�B�Bc�<�eZdZ	dd�Zdd�Zd�Zed���ZdS)	r�Nc���||_|�d���g|_d|_t	jd|j��t	j|tj|j|jfd���|_	dS)NT)�firstz listener created with address=%rrr3)
r�_new_handle�
_handle_queuerr�	sub_debugr@r��_finalize_pipe_listenerrX)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�rrrrrr r!r"�PIPE_UNLIMITED_INSTANCESrr#r$)rErL�flagss   rrMzPipeListener._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��\}}nJ#|�d��\}}wxYw#t$r }|j
tjkr�Yd}~nd}~wwxYwt|��S)NrTr�F)rN�appendrM�popr�r(r�r�rr�r�r�rQr��
ERROR_NO_DATAr�)rErFr��resr/r�r�s       rr�zPipeListener.accept�s8����%�%�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�s��R�3�3�D�9�9�F�A�s�#�O�O�O���
�
�
��:��!6�6�6��7�6�6�6�6�����
���� "�&�)�)�)s6�C&�!B�C	�+B,�,C	�	C#�&
D�0D�Dc�b�tjd|��|D]}tj|���dS)Nz closing listener with address=%r)rrOr�r�)�queuer<rFs   rrPz$PipeListener._finalize_pipe_listener�sB���N�=�w�G�G�G��
,�
,���#�F�+�+�+�+�
,�
,rr)F)r�r�r�rIrMr��staticmethodrPr�rrr�r��sk������	�		�		�		�		�
	�
	�
	�
	�	*�	*�	*�.
�	,�	,�
��	,�	,�	,rr�c	���	t��}		tj|d��tj|tjtjzdtjtjtjtj��}nG#t$r9}|j
tjtjfvst|��r�Yd}~nd}~wwxYw��tj|tjdd��t!|��S)Nr��r)rr��
WaitNamedPiper%rrr$r&rrQr��ERROR_SEM_TIMEOUT�ERROR_PIPE_BUSYrr'r!r�)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_LENGTHro�	CHALLENGE�new�digestrz�WELCOME�FAILUREr	��
connectionr�rg�messagerm�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���ddl}t|t��s/td�t|�������|�d��}|tt��d�}|�	||d���
��}|�|��|�d��}|tkrtd���dS)Nrrdrfrezdigest sent was rejected)rgr�r�r,rhr7rzr|rkrlrmrornr	rps      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�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)rarXr�rzro)�_conn�_dumps�_loadsr6�setattr)rE�connrrr��attrrts      rrIzConnectionWrapper.__init__sT����
�������K�	%�	%�D��$��%�%�C��D�$��$�$�$�$�	%�	%rc�d�|�|��}|j�|��dSr)ryrxro)rErtrFs   rruzConnectionWrapper.sends/���K�K������
���a� � � � � rc�^�|j���}|�|��Sr)rxrzrzrEs  rr�zConnectionWrapper.recvs%���J�!�!�#�#���{�{�1�~�~�rN)r�r�r�rIrur�r�rrrvrvsA������%�%�%�!�!�!�����rrvc�f�t�|fdddd���d��S)Nr�utf-8)�	xmlrpclibrr�encode)rts r�
_xml_dumpsr�s,���?�?�C�6�4��t�Q�7�7�>�>�w�G�G�Grc�j�t�|�d����\\}}|S)Nr�)r�r��decode)rFrt�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�rvr�r�rss  rr�zXmlListener.accept%s7��)�)�)�)�)�)��o�o�d�#�#�� ��j�*�=�=�=rN)r�r�r�r�r�rrr�r�$s#������>�>�>�>�>rr�c�X�ddlmatt	|i|��t
t��Sr�)r�r�r�rvrr�r�)r4�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�rU)�handlesr�L�readyrXs     r�_exhaustive_waitr�6s���
��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)Nrr]g�?raT�)�r�Fr�c3�(�K�|]}�|V��
dSrr�)�.0ra�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��setr6r�r�rQr��
_ready_errorsr�rUr�r1�getwindowsversionr�r3r��add�AttributeErrorrAr��keysr�r��update)�object_listr�ov_list�
ready_handlesr�rar�r�r�r/r�r�s          @@rrrLs]����	�
�?��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��I4�"E:�3!B�I4�
B<�B7�2I4�7B<�<AI4�D*�)I4�*
E�4E�;I4�E�5I4�:!F�I4�F�%I4�"G;�;
H �H�H �4L%�J,�+L%�,
K	�6K	�L%�K	�AL%�PollSelectorc�p�	t��5}|D]"}|�|tj���#|�t	j��|z}	|�|��}|rd�|D��cddd��S|�*|t	j��z
}|dkr|cddd��S�\#1swxYwYdS)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�selectorrt�deadliner�s      rrr�s9��	�
�_�_�	)��"�
=�
=���!�!�#�y�';�<�<�<�<��"��>�+�+�g�5��
)� ����0�0���)�C�C�U�C�C�C�	)�	)�	)�	)�	)�	)�	)�	)��*�"*�T�^�-=�-=�"=��"�Q�;�;�#(�	)�	)�	)�	)�	)�	)�	)�	)�
)�	)�	)�	)�	)����	)�	)�	)�	)�	)�	)s�A!B+�>B+�*B+�+B/�2B/c��|���}tj|tjtj��5}ddlm}|�|��}t||j	|j
ffcddd��S#1swxYwYdS)Nr)�resource_sharer)rar4�fromfdr�SOCK_STREAMr$r��	DupSocket�rebuild_connectionrGrH)r|rFrFr��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�	DupHandlera�rebuild_pipe_connection)r|r*�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�DupFdrar�rGrH)r|�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)J�__all__r�r�r(r1r4r�rr%�	itertoolsr�r$rr	r
�contextr�ForkingPicklerrqr�rr
rr�ImportErrorr2r�CONNECTION_TIMEOUT�countr+r��familiesr3rrr/r5r=r?r�r��objectrrrr�rr�rrjrkrnror�r�rvr�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�_�]�]�]�]�]��]�]�]�@M�M�M�M�M��M�M�M�h;�;�;�;�;�v�;�;�;�|
�
�
�
�*�<�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�A0�/A0