Your IP : 18.118.82.168


Current Path : /opt/alt/python313/lib64/python3.13/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/multiprocessing/__pycache__/connection.cpython-313.opt-1.pyc

�

+}gѣ���/SQrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
Jr SSK
JrJ
r
 SSKJr \R rSSKrSSKrSSKJrJrJrJr S	rS
r\	R8"5rSrS/r\ "\S5(aSr\S/-
r\R2S:XaS
r\S
/-
r\4Sjr!Sr"Sr#Sr$Sr%"SS5r&\(a"SS\&5r'"SS\&5r("SS\)5r*SESjr+\R2S:waSFSjr,OSFSjr,"SS\)5r-S r.\R2S:Xa"S!S"\)5r/S#r0S$r1S%r2S&r3S'r4\5"1S(k5r6\7"S)\655r8S*r9S+r:\9\:4r;S,\<S-\=\<44S.jr>S/r?S0r@SGS1\<4S2jjrAS1\<4S3jrB"S4S5\)5rCS6rDS7rE"S8S9\*5rFS:rG\R2S:Xa!S;rH\R�\R�1rKSHS<jrLO0SSKMrM\ "\MS=5(a
\MR�rOO\MR�rOSHS>jrL\R2S:Xa3S?rQS@rR\R�"\(\Q5 SArTSBrU\R�"\'\T5 gSCrQSDrR\R�"\(\Q5 g!\a \R2S:XaeSrGNf=f)I)�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�2�[R"5U-$�N��time�	monotonic)�timeouts �A/opt/alt/python313/lib64/python3.13/multiprocessing/connection.py�
_init_timeoutr<s���>�>��g�%�%�c�2�[R"5U:�$rr)�ts r�_check_timeoutr?s���>�>��a��rc��US:XagUS:Xa([R"S[R"5S9$US:Xa:[R"S[R
"5[
[54-SS9$[S	5e)
z7
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/Fsy������	�9�	����k�t�7H�7H�7J�K�K�	�9�	����&<� "�	�	��T�-�-@�A�'B�GI�K�	K��.�/�/rc���[RS:waUS:Xa[SU-5e[RS:Xa+US:Xa$[[U5(d[SU-5eggg)z<
Checks if the family is valid for the current environment.
rrzFamily %s is not recognized.rN)�sys�platformr,�hasattr�socketr-s r�_validate_familyr5Tsf���|�|�w��6�Y�#6��7�&�@�A�A�
�|�|�w��6�Y�#6��v�v�&�&��;�f�D�E�E�'�$7�rc���[U5[:Xag[U5[LaURS5(ag[U5[Ld[R
"U5(ag[
SU-5e)zQ
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=`sb���G�}����	
�g��#�	�'�"4�"4�V�"<�"<��	
�g��#�	��!B�!B�7�!K�!K���:�W�D�E�Erc��\rSrSrSrSSjrSrSrSrSr	Sr
\S	5r\S
5r
\S5rSrS
rSSjrSrSSjrSSjrSrSSjrSrSrSrg)�_ConnectionBase�sNc��UR5nUS:a[S5eU(dU(d[S5eXlX lX0lg)Nrzinvalid handlez6at least one of `readable` and `writable` must be True)�	__index__r,�_handle�	_readable�	_writable)�self�handle�readable�writables    r�__init__�_ConnectionBase.__init__vsI���!�!�#���A�:��-�.�.����H�J�
J���!��!�rc�@�URbUR5 ggr�rC�_close�rFs r�__del__�_ConnectionBase.__del__�s���<�<�#��K�K�M�$rc�4�URc[S5eg)N�handle is closed)rC�OSErrorrOs r�
_check_closed�_ConnectionBase._check_closed�s���<�<���,�-�-� rc�<�UR(d[S5eg)Nzconnection is write-only)rDrTrOs r�_check_readable�_ConnectionBase._check_readable�s���~�~��4�5�5�rc�<�UR(d[S5eg)Nzconnection is read-only)rErTrOs r�_check_writable�_ConnectionBase._check_writable�s���~�~��3�4�4�rc�j�UR(aSUlOUR5 [S5e)NFzbad message length)rErD�closerTrOs r�_bad_message_length�#_ConnectionBase._bad_message_length�s%���>�>�"�D�N��J�J�L��*�+�+rc��URSL$)z True if the connection is closedN�rCrOs r�closed�_ConnectionBase.closed�s���|�|�t�#�#rc��UR$)z"True if the connection is readable)rDrOs rrH�_ConnectionBase.readable�����~�~�rc��UR$)z"True if the connection is writable)rErOs rrI�_ConnectionBase.writable�rgrc�:�UR5 UR$)z+File descriptor or handle of the connection)rUrCrOs r�fileno�_ConnectionBase.fileno�s�������|�|�rc�h�URbUR5 SUlgg!SUlf=f)zClose the connectionNrMrOs rr^�_ConnectionBase.close�s1���<�<�#�
$����
�#���	$�� $���s�(�	1c�x�UR5 UR5 [U5nURS:�aUR	S5nUR
nUS:a[
S5eXR:a[
S5eUcXR-
nO$US:a[
S5eX#-U:�a[
S5eURXBX#-5 g)	z,Send the bytes data from a bytes-like objectr�Brzoffset is negativezbuffer length < offsetNzsize is negativezbuffer length < offset + size)rUr[�
memoryview�itemsize�cast�nbytesr,�_send_bytes)rF�buf�offset�size�m�ns      r�
send_bytes�_ConnectionBase.send_bytes�s������������s�O���:�:��>����s��A�
�H�H���A�:��1�2�2��:��5�6�6��<��:�D�
�A�X��/�0�0�
�]�Q�
��<�=�=�����&�-�0�1rc��UR5 UR5 UR[R	U55 g)zSend a (picklable) objectN)rUr[ru�_ForkingPickler�dumps�rF�objs  r�send�_ConnectionBase.send�s3��������������.�.�s�3�4rc���UR5 UR5 UbUS:a[S5eURU5nUcUR	5 UR5$)z'
Receive bytes data as a bytes object.
rznegative maxlength)rUrXr,�_recv_bytesr_�getvalue)rF�	maxlengthrvs   r�
recv_bytes�_ConnectionBase.recv_bytes�sa��	
��������� �Y��]��1�2�2����y�)���;��$�$�&��|�|�~�rc���UR5 UR5 [U5nURnU[	U5-nUS:a[S5eX%:�a[S5eUR
5nUR5nXRU-:a[UR55eURS5 URX2U-X'-U-5 UsSSS5 $!,(df   g=f)zY
Receive bytes data into a writeable bytes-like object.
Return the number of bytes read.
rznegative offsetzoffset too largeN)rUrXrqrr�lenr,r��tellr
r��seek�readinto)rFrvrwryrr�bytesize�resultrxs        r�recv_bytes_into�_ConnectionBase.recv_bytes_into�s���
	
��������
��_���z�z�H��#�a�&�(�H���z� �!2�3�3��"� �!3�4�4��%�%�'�F��;�;�=�D��4�-�'�$�V�_�_�%6�7�7��K�K��N��O�O�A��0�%�}��9�;�
<��!�_�_�s�B*C � 
C.c��UR5 UR5 UR5n[R	UR55$)zReceive a (picklable) object)rUrXr�r~�loads�	getbuffer)rFrvs  r�recv�_ConnectionBase.recv�s?������������� ���$�$�S�]�]�_�5�5rc�d�UR5 UR5 URU5$)z/Whether there is any input available to be read)rUrX�_poll�rFrs  r�poll�_ConnectionBase.poll�s)�����������z�z�'�"�"rc��U$r�rOs r�	__enter__�_ConnectionBase.__enter__����rc�$�UR5 gr�r^�rF�exc_type�	exc_value�exc_tbs    r�__exit__�_ConnectionBase.__exit__����
�
�r)rCrDrE)TT)rNr)r)g)�__name__�
__module__�__qualname__�__firstlineno__rCrJrPrUrXr[r_�propertyrcrHrIrkr^r{r�r�r�r�r�r�r��__static_attributes__r�rrr?r?ss����G�	"��.�6�5�,��$��$����������
$�2�(5���26�#��rr?c�\�\rSrSrSrSrSr\R4Sjr	Sr
SSjrSrS	r
S
rg)�PipeConnectioniz�
Connection class based on a Windows named pipe.
Overlapped I/O is used, so the handles must have been created
with FILE_FLAG_OVERLAPPED.
FNc�f�URnUbUR5 U"UR5 gr)�_send_ov�cancelrC)rF�_CloseHandle�ovs   rrN�PipeConnection._closes%�����B��~��	�	������&rc��URb[S5e[R"URUSS9up#X lU[R
:Xa'[R"UR/S[5nSUlURS5upSU[R:Xa[[RS5eg! UR5 e=f!SUlURS5upSf=f)Nz/concurrent send_bytes() calls are not supportedT��
overlappedFrS)r�r,�_winapi�	WriteFilerC�ERROR_IO_PENDING�WaitForMultipleObjects�eventrr��GetOverlappedResult�ERROR_OPERATION_ABORTEDrT�errno�EPIPE)rFrvr��err�waitres�nwrittens      rru�PipeConnection._send_bytess����}�}�(� �"5�6�6��'�'����c�d�K�G�B��M�

=��'�2�2�2�%�<�<����
�E�8�5�G�!%��
� "� 6� 6�t� <�
���g�5�5�5��e�k�k�+=�>�>�	6��

��	�	���� $��
� "� 6� 6�t� <�
��#�s�;C�C�C�C8c���UR(aSUl[R"5$UcSO[US5n[R
"URUSS9up4U[R:Xa'[R"UR/S[5nURS5updUS:Xa6[R"5nURUR55 U$U[R:XaUR!X15$[+S5e! UR5 e=f!URS5updUS:Xa:[R"5nURUR55 Us s$U[R:XaUR!X15s s$f=f!["a*nUR$[R&:Xa[(eeSnAff=f)NF�Tr�rz.shouldn't get here; expected KeyboardInterrupt)�_got_empty_message�io�BytesIO�minr��ReadFilerCr�r�r�rr�r��writer��ERROR_MORE_DATA�_get_more_datarT�winerror�ERROR_BROKEN_PIPE�EOFError�RuntimeError)	rF�maxsize�bsizer�r�r��nread�f�es	         rr��PipeConnection._recv_bytes6s����&�&�*/��'��z�z�|�#�&���C���4E���%�.�.�t�|�|�U�;?�A�G�B�D��'�":�":�:�&-�&D�&D�!#���
�E�8�'=�G�&(�%;�%;�D�%A�
���!�8� "�
�
��A��G�G�B�L�L�N�3�#$�H� �G�$;�$;�;�#'�#6�#6�r�#C�C�<��O�P�P��!��	�	����%'�%;�%;�D�%A�
���!�8� "�
�
��A��G�G�B�L�L�N�3�#$�H� �G�$;�$;�;�#'�#6�#6�r�#C�C�<�����z�z�W�%>�%>�>�&����	�s\�"F5�#;D�AF5�-$F5�D1�1D4�4AF2�F5�'F2�/F5�1F2�2F5�5
G)�?%G$�$G)c��UR(d'[R"UR5SS:wag[	[U/U55$)NrT)r�r��
PeekNamedPiperC�boolrr�s  rr��PipeConnection._pollVs>���'�'��-�-�d�l�l�;�A�>�!�C����d�V�W�-�.�.rc��UR5n[R"5nURU5 [R
"UR5SnUb"[U5U-U:�aUR5 [R"URUSS9upURS5upvURUR55 U$)NrTr�)r�r�r�r�r�r�rCr�r_r�r�)rFr�r�rvr��leftr��rbytess        rr��PipeConnection._get_more_data\s����,�,�.�C��
�
��A�
�G�G�C�L��(�(����6�q�9�D��"�s�3�x�$���'@��(�(�*��&�&�t�|�|�T�d�K�G�B��0�0��6�K�F�
�G�G�B�L�L�N�#��Hr)r�r�r)r�r�r�r��__doc__r�r�r��CloseHandlerNrur�r�r�r�r�rrr�r�s8��	�
#����&-�&9�&9�	'�	(�4	Q�@	/�
	rr�c��\rSrSrSr\(a)\R4Sjr\Rr
\RrO(\
R4Sjr\
Rr
\
R r\
4Sjr\4SjrSrSS	jrS
rSrg)
�
Connectionilzc
Connection class based on an arbitrary file descriptor (Unix only), or
a socket handle (Windows).
c�(�U"UR5 grrb�rFrNs  rrN�Connection._closes����4�<�<� rc�(�U"UR5 grrbr�s  rrNr�xr�rc�b�[U5nU"URU5nX4-nUS:XagXSnM$�Nr)r�rC)rFrvr��	remainingrzs     r�_send�Connection._send}s=����H�	���d�l�l�C�(�A��N�I��A�~���b�'�C�rc���[R"5nURnUnUS:�aLU"XE5n[U5nUS:XaXQ:Xa[e[S5eUR
U5 XW-nUS:�aMLU$)Nrzgot end of file during message)r�r�rCr�r�rTr�)rFrx�readrvrGr��chunkrzs        r�_recv�Connection._recv�sv���j�j�l�������	��!�m���+�E��E�
�A��A�v��$�"�N�!�"B�C�C��I�I�e���N�I��!�m��
rc��[U5nUS:�ab[R"SS5n[R"SU5nURU5 URU5 URU5 g[R"SU5nUS:�a#URU5 URU5 gURXA-5 g)Ni����!i����!Qi@)r��struct�packr�)rFrvrz�
pre_header�headers     rru�Connection._send_bytes�s�����H���z�>����T�2�.�J��[�[��q�)�F��J�J�z�"��J�J�v���J�J�s�O��[�[��q�)�F��5�y��
�
�6�"��
�
�3���
�
�6�<�(rNc�"�URS5n[R"SUR55unUS:Xa8URS5n[R"SUR55unUbX1:�agURU5$)N�r�r��r�)r�r��unpackr�)rFr�rvrxs    rr��Connection._recv_bytes�so���j�j��m���
�
�d�C�L�L�N�3����2�:��*�*�Q�-�C��M�M�$�����7�E�D���4�>���z�z�$��rc�2�[U/U5n[U5$r)rr�)rFr�rs   rr��Connection._poll�s���$���!���A�w�rr�r)r�r�r�r�r�r��_multiprocessing�closesocketrNr��_writer��_readr(r^r�r�r�r�rur�r�r�r�rrr�r�lso���
� 0� <� <�	!�!�&�&�� �%�%�� "���	!���������%�� %�� )�. �rr�c�Z�\rSrSrSrSSjrSrSr\S5r	\S5r
S	rS
rSr
g)
ri�z�
Returns a listener object.

This is a wrapper for a bound socket which is 'listening' for
connections, or for a Windows named pipe.
Nc�8�U=(d! U=(a [U5=(d [nU=(d [U5n[U5 US:Xa[	X5UlO[
XU5UlUb [U[5(d[S5eX@l
g)Nr�authkey should be a byte string)r=�default_familyr/r5�PipeListener�	_listener�SocketListener�
isinstance�bytes�	TypeError�_authkey)rFr<r.�backlog�authkeys     rrJ�Listener.__init__�s����#�G�=��W�(=�#�"�	��6�.�v�6���� ��Y��)�'�;�D�N�+�G�W�E�D�N���z�'�5�'A�'A��=�>�>��
rc���URc[S5eURR5nURb*[	XR5 [XR5 U$)zb
Accept a connection on the bound socket or named pipe of `self`.

Returns a `Connection` object.
zlistener is closed)rrT�acceptr�deliver_challenge�answer_challenge)rF�cs  rr�Listener.accept�sS���>�>�!��.�/�/��N�N�!�!�#���=�=�$��a���/��Q�
�
�.��rc�R�URnUbSUlUR5 gg)z1
Close the bound socket or named pipe of `self`.
N)rr^)rF�listeners  rr^�Listener.close�s)���>�>����!�D�N��N�N�� rc�.�URR$r)r�_addressrOs rr<�Listener.address�s���~�~�&�&�&rc�.�URR$r)r�_last_acceptedrOs r�
last_accepted�Listener.last_accepted�s���~�~�,�,�,rc��U$rr�rOs rr��Listener.__enter__�r�rc�$�UR5 grr�r�s    rr��Listener.__exit__�r�r)rr)NNrN)r�r�r�r�r�rJrr^r�r<r)r�r�r�r�rrrr�sH��� � 
���'��'��-��-��rrc��U=(d [U5n[U5 US:Xa[U5nO[U5nUb [	U[
5(d[
S5eUb[X25 [X25 U$)z5
Returns a connection to the address of a `Listener`
rr)	r=r5�
PipeClient�SocketClientrrrrr)r<r.rrs    rrr�sp���
,�|�G�,�F��V��
����w�����!����:�g�u�#=�#=��9�:�:�����$��!�%��Hrc�H�U(an[R"5upURS5 URS5 [UR	55n[UR	55nX44$[
R"5upV[USS9n[USS9nX44$)�<
Returns pair of connection objects at either end of a pipe
TF�rI�rH)r4�
socketpair�setblockingr��detachr(�pipe)�duplex�s1�s2�c1�c2�fd1�fd2s       rrrs�����&�&�(�F�B��N�N�4� ��N�N�4� ��B�I�I�K�(�B��B�I�I�K�(�B��v�
�	�w�w�y�H�C��C�%�0�B��C�%�0�B��v�
rc
�n�[S5nU(a=[Rn[R[R-n[
[
pTO'[Rn[RnS[
pT[R"X[R-[R-[R[R-[R-SXE[R[R5n[R"XS[R[R [R[R5n[R""U[RSS5 [R$"USS9nUR'S5up�[)X`S9n[)XpS9nX�4$)	r3rrrNTr�r4r5)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�r=r>s
             rrr(sN��$�I�.����1�1�H��)�)�G�,A�,A�A�F�$�g�F��2�2�H��*�*�F���F�
�
$�
$��� <� <�<��1�1�2��%�%��(E�(E�E����
�
�v�w�;�;��L�L����
�
��Q����g�.C�.C��(�(�'�,�,���	�'�'���-�-�t�T�	��-�-�b�T�B�
��/�/��5����B�
0��
�B�
0���v�
rc�.�\rSrSrSrSSjrSrSrSrg)	riTzG
Representation of a socket which is bound to an address and listening
c���[R"[[U55Ul[RS:Xa9URR[R[RS5 URRS5 URRU5 URRU5 URR5UlX lSUlUS:XaG["R$"U5(d,["R&"U[R(U4SS9UlgSUlg![a URR5 ef=f)N�posixrTrr��args�exitpriority)r4�getattr�_socketr(�name�
setsockopt�
SOL_SOCKET�SO_REUSEADDRr7�bind�listen�getsocknamer%rTr^�_familyr(rr;�Finalize�unlink�_unlink)rFr<r.rs    rrJ�SocketListener.__init__Xs
���}�}�W�V�V�%<�=���	��w�w�'�!����'�'��(9�(9�(.�(;�(;�Q�@��L�L�$�$�T�*��L�L���g�&��L�L����(� �L�L�4�4�6�D�M���"����Y��t�'H�'H��'Q�'Q��=�=��b�i�i�w�j�q��D�L� �D�L���	��L�L��� ��	�s�B=E
�
&E0c��URR5uolURS5 [	UR55$)NT)rarr(r7r�r8�rF�ss  rr�SocketListener.acceptqs7��!%���!4�!4�!6����	�
�
�d���!�(�(�*�%�%rc��URR5 URnUbSUlU"5 gg!URnUbSUlU"5 ff=fr)rar^rl)rFrks  rr^�SocketListener.closevs[��	��L�L��� ��\�\�F��!�#�����"���\�\�F��!�#�����"�s	�;� A)r%rir(rarlN)r)	r�r�r�r�r�rJrr^r�r�rrrrTs��� �2&�
rrc��[U5n[R"[[U55nURS5 UR	U5 [UR
55sSSS5 $!,(df   g=f)zG
Return a connection object connected to the socket given by `address`
TN)r=r4r`r7�connectr�r8)r<r.rps   rr1r1�sU���'�
"�F�	������/�	1�Q�	�
�
�d��	�	�	�'���!�(�(�*�%�
2�	1�	1�s�;A5�5
Bc�B�\rSrSrSrS	SjrS
SjrSr\S5r	Sr
g)ri�z 
Representation of a named pipe
Nc�
�XlURSS9/UlSUl[R
"SUR5 [R"U[RURUR4SS9Ul	g)NT)�firstz listener created with address=%rrr])
r%�_new_handle�
_handle_queuer(r�	sub_debugrjr�_finalize_pipe_listenerr^)rFr<rs   rrJ�PipeListener.__init__�sj��#�M�"&�"2�"2��"2�">�!?�D��"&�D���N�N�=�t�}�}�M�����l�:�:��(�(�$�-�-�8�q��D�Jrc
��[R[R-nU(aU[R-n[R"UR
U[R[R-[R-[R[[[R[R5$r)
r�rBrHrIrGr%rJrKrL�PIPE_UNLIMITED_INSTANCESrErMrN)rFrx�flagss   rry�PipeListener._new_handle�s����.�.��1M�1M�M�E����>�>�>���*�*��
�
�u��)�)�G�,I�,I�I��!�!�"��0�0�'�7��,�,�g�l�l��
rc�8�URRUR55 URRS5n[R
"USS9n[R"UR/S[5nURS5upE[U5$! UR5 [R"U5 e=f!URS5upEf=f![a)nUR[R:waeSnAN}SnAff=f)NrTr�F)rz�appendry�popr�rRr�r�rr�r�r�rTr��
ERROR_NO_DATAr�)rFrGr��resrYr�r�s       rr�PipeListener.accept�s������%�%�d�&6�&6�&8�9��'�'�+�+�A�.�F�
$��-�-�f��F��	$�!�8�8����
�E�8�5�C� �3�3�D�9�F�A�!�&�)�)����I�I�K��'�'��/����3�3�D�9�F�A�s���
��:�:��!6�!6�6��7��
�s0�C&�'B"�")C�C�C#�&
D�0D�Dc�p�[R"SU5 UHn[R"U5 M g)Nz closing listener with address=%r)rr{r�r�)�queuer<rGs   rr|�$PipeListener._finalize_pipe_listener�s)���N�N�=�w�G����#�#�F�+� r)r%rzr(r^r)F)r�r�r�r�r�rJryr�staticmethodr|r�r�rrrr�s*��	�		�
	�	*�.
�	,�
�	,rrc	�F�[5n[R"US5 [R"U[R[R
-S[R[R[R[R5n[R"U[RSS5 [!U5$![aInUR[R[R4;d[U5(aeSnAOSnAff=fGM)zE
Return a connection object connected to the pipe given by `address`
��rN)rr��
WaitNamedPiperOrCrDrNrPrHrTr��ERROR_SEM_TIMEOUT�ERROR_PIPE_BUSYrrQrKr�)r<r�hr�s    rr0r0�s���
�O���
��%�%�g�t�4��&�&��W�1�1�G�4I�4I�I��w�|�|�W�%:�%:��0�0�'�,�,����	�'�'�
�w�,�,�d�D�	��a� � ���
��:�:�g�&?�&?�&-�&=�&=�&?�?�BP�QR�BS�BS��CT��
��s�B
C
�

D�?D�D�(s#CHALLENGE#s	#WELCOME#s	#FAILURE#>�md5�sha256�sha384�sha3_256�sha3_384c#�8# �UHn[U5v� M g7fr)r�)�.0rYs  r�	<genexpr>r�Fs���7�&6��c�!�f�f�&6�s����message�returnc��[U5[;aSU4$URS5(aIURSS[S-5=nS:�a)USUnU[
;aXS-SnUR
S5U4$[S	U<35e)
z�Returns a digest name and the payload for a response hash.

If a legacy protocol is detected based on the message length
or contents the digest name returned will be empty to indicate
legacy mode where MD5 and no digest prefix should be sent.
r$�{�}r�rN�asciizRunsupported message length, missing digest prefix, or unsupported digest: message=)r��_LEGACY_LENGTHSr:�find�_MAX_DIGEST_LEN�_ALLOWED_DIGESTS�decoder	)r��curly�digest�payloads    r�_get_digest_name_and_payloadr�Qs����7�|��&�
�7�{�����4� � ��,�,�t�Q���(9�:�	:��a�?���5�!���%�%��A�g�h�'�G��=�=��)�7�2�2�
�
/�&-�Z�
1�2�2rc��SSKn[U5SnU(d!URXS5R5$URXU5R5nSURS5U4-$![a SnNDf=f)aoCreate a MAC based on authkey and message

The MAC algorithm defaults to HMAC-MD5, unless MD5 is not available or
the message has a '{digest_name}' prefix. For legacy HMAC-MD5, the response
is the raw MAC, otherwise the response is prefixed with '{digest_name}',
e.g. b'{sha256}abcdefg...'

Note: The MAC protects the entire message including the digest_name prefix.
rN�md5�sha256�{%s}%sr�)�hmacr��newr�r,�encode)rr�r��digest_name�responses     r�_create_responser�ks����.�w�7��:�K��	#��8�8�G�e�4�;�;�=�=��x�x��+�6�=�=�?�H���*�*�7�3�X�>�>�>���	#�#�K�		#�s�A1�1B�?Bc
�z�SSKn[U5upEU=(d SnURXU5R5n[
U5[
U5:wa'[SU<S[
U5S[
U535eURXe5(d[S	5eg![a [SU<S35ef=f)
aHVerify MAC challenge

If our message did not include a digest_name prefix, the client is allowed
to select a stronger digest_name from _ALLOWED_DIGESTS.

In case our message is prefixed, a client cannot downgrade to a weaker
algorithm, because the MAC is calculated over the entire message
including the '{digest_name}' prefix.
rNr�zresponse_digest=z unsupportedz	expected z of length z got zdigest received was wrong)r�r�r�r�r,r	r��compare_digest)rr�r�r��response_digest�response_mac�expecteds       r�_verify_challenger��s����$@��$J�!�O�%�.��O�E��8�8�G�o�>�E�E�G���8�}��L�)�)�!��O�.�k�#�h�-��I��<�(�)�+�,�	,����x�6�6�!�"=�>�>�7��
�E�!�%5�_�$6�l�"C�D�D�E�s� B�B:rc��[U[5(d#[SR[	U555e[
R"[5nSURS5U4-nUR[U-5 URS5n[XU5 UR[5 g![a UR[5 ef=f)N� Authkey must be bytes, not {0!s}r�r��)rrr,�formatr7r(�urandom�MESSAGE_LENGTHr�r{�
_CHALLENGEr�r��_WELCOMEr	�_FAILURE)�
connectionrr�r�r�s     rrr�s����g�u�%�%��.�5�5�d�7�m�D�F�	F��j�j��(�G��;�-�-�g�6��@�@�G����*�w�.�/��$�$�S�)�H�(��'�H�5�
	���h�'��	�����h�'�
��s�B5�5!Cc���[U[5(d#[SR[	U555eURS5nUR
[5(d[SU<35eU[[5Sn[U5[:a[S[U5S35e[X5nURU5 URS5nU[:wa[S5eg)Nr�r�z,Protocol error, expected challenge: message=zchallenge too short: z byteszdigest sent was rejected)rrr,r�r7r�r:r�r	r��_MD5ONLY_MESSAGE_LENGTHr�r{r�)r�rr�r�r�s     rrr�s����g�u�%�%��.�5�5�d�7�m�D�F�	F��#�#�C�(�G����j�)�)�!�?�w�j�A�C�	C��c�*�o�&�'�G�
�7�|�-�-�!�$9�#�g�,��v�"N�O�O�
�g�
/�F����&�!��$�$�S�)�H��8��!�"<�=�=�rc�&�\rSrSrSrSrSrSrg)�ConnectionWrapperi�c�h�XlX lX0lSHn[X5n[	XU5 M g)N)rkr^r�r�r{)�_conn�_dumps�_loadsr`�setattr)rF�connrr��attrr�s      rrJ�ConnectionWrapper.__init__�s0���
�����K�D��$�%�C��D��$�Lrc�\�URU5nURRU5 gr)r�r�r{)rFr�rps   rr��ConnectionWrapper.send�s"���K�K�����
�
���a� rc�X�URR5nURU5$r)r�r�r�ros  rr��ConnectionWrapper.recv�s"���J�J�!�!�#���{�{�1�~�r)r�r�r�N)r�r�r�r�rJr�r�r�r�rrr�r��s��%�!�rr�c�T�[RU4SSSS5RS5$)Nr�utf-8)�	xmlrpclibrr�)r�s r�
_xml_dumpsr��s&���?�?�C�6�4��t�Q�7�>�>�w�G�Grc�V�[RURS55uupU$)Nr�)r�r�r�)rpr��methods   r�
_xml_loadsr��s"���_�_�Q�X�X�g�%6�7�N�F�S��Jrc��\rSrSrSrSrg)�XmlListeneri�c�b�SSKJq [R	U5n[U[[5$r�)�
xmlrpc.client�clientr�rrr�r�r�r�s  rr�XmlListener.accept�s"��)��o�o�d�#�� ��j�*�=�=rr�N)r�r�r�r�rr�r�rrr�r��s��>rr�c�J�SSKJq [[	U0UD6[
[5$r�)r�r�r�r�rr�r�)r^�kwdss  r�	XmlClientr��s��%��V�T�2�T�2�J�
�K�Krc�^�[U5m/n[T5S:�au[R"TSU5nURU4SjU55 U(a8[
T5VVs/sHupEXCSU-s=:�aU;dMO MUPM! snnmSnT(a�[T5S:�aTSSOTn[R"USU5nU[:XaU$[Us=::a[[T5-:a
O O
U[-nO9[Us=::a[[T5-:a
O O
U[-nO[S5eURTU5 TUS-SmSnT(aM�U$![a /s$f=fs snnf)N�<Fc3�.># �UH
nTUv� M g7frr�)r��i�Ls  �rr��#_exhaustive_wait.<locals>.<genexpr>�s����+�s�!��1��s���rzShould not get herer)
�listr�r��BatchedWaitForMultipleObjects�TimeoutError�extend�	enumerater�rrr
r�r�)�handlesr�readyr�r�r��short_Lr�s       @r�_exhaustive_waitr��sc���
��M�����q�6�B�;�
��;�;�A�u�g�N��
�L�L�+�s�+�+��#,�Q�<�M�<�4�1�1�1�v��z�3L��3L�Q�3L�Q�<�M���G�� #�A����a���f��G��0�0��%��I�C��l�"�����#�>�
��A��(>�>��}�$��!�S�D�+;�c�!�f�+D�D��'�'��"�#8�9�9��L�L��3�� ��#�a�%�&�	�A��G��a����) �
��	�
��Ns#�E%�'E7�E7�E7�%E4�3E4c��^�Uc[nOUS:aSnO[US-S-5n[U5n0m/n[5n[5nUH�n[	US5n[
R"U"5SS5upxU[
R:Xa"URU5 UTUR'MfU(aO[R"5SSS:�a3URS	5up�U(d[!US
5(aSUlUR%U5 SnM� [+TR-5U5nUHnUR/5 M UHonURS5up�U[
R0:wdM-TURnUR%U5 US:XdMU[!US
5(dMhSUlMq UR3U4SjU55 UVs/sHoUU;dM
UPM sn$![a#n	SU	Rp�U[;aeSn	A	GN�Sn	A	ff=f![an	U	RnSn	A	GN_Sn	A	ff=f![&a UTUR)5'GM%f=f![a"n	U	RnU[;aeSn	A	GN1Sn	A	ff=f!UHnUR/5 M UH�nURS5up�O.![a!n	U	RnU[;aeSn	A	OSn	A	ff=fU[
R0:wdM\TURnUR%U5 US:XdM�[!US
5(dM�SUlM� f=fs snf)�
Wait till an object in object_list is ready/readable.

Returns list of those objects in object_list which are ready/readable.
Nrr�g�?rkTr�)�r�Fr�c3�.># �UH
nTUv� M g7frr�)r�r��waithandle_to_objs  �rr��wait.<locals>.<genexpr>_s����I�=�a�.�q�1�=�r�)r�intr��setr`r�r�rTr��
_ready_errorsr�r�r�r1�getwindowsversionr�r3r��add�AttributeErrorrBr��keysr�r��update)�object_listr�ov_list�
ready_objects�
ready_handles�orkr�r�r�rYr�s           @rrrs,����?��G�
�q�[��G��'�D�.�3�.�/�G��;�'��������
���
�6	8� ��$�$�Q��1�F�
"�")�"2�"2�6�8�Q��"E���
�g�6�6�6����r�*�67�)�"�(�(�3�
�#�"7�"7�"9�"�1�"=��"G�1�)+�)?�)?��)F���$'�7�1�6J�+K�+K�7;�� 4�%�)�)�!�,�"#��=!�@-�->�-C�-C�-E�w�O�M����	�	�������3�3�D�9�F�A�
�'�9�9�9�)�"�(�(�3�A�!�%�%�a�(��a�x�#�1�&:�;�;�37�A�0�� 	���I�=�I�I�&�=�;�a�}�*<��;�=�=��_#�"�"&��
�
�C��m�3�!�4��"�� $+�1�&'�j�j���1��-&�9�78�%�a�k�k�m�4�9��N���*�*�C��-�/��0�������	�	�������3�3�D�9�F�A�s�����*�*�C��-�/��0�����'�9�9�9�)�"�(�(�3�A�!�%�%�a�(��a�x�#�1�&:�;�;�37�A�0���">s��
J$�I�G<�<AJ$�H,�)AJ$�I5�&	M&�3M&�<
H)�H$�J$�$H)�)J$�,
I
�6I�J$�I
�
J$�I2�-J$�1I2�2J$�5
J!�?J�J!�$M#�K�M#�
L	�"K>	�9M#�>L	�M#�$M#�M#�M#�PollSelectorc��[5nUH#nURU[R5 M% Ub[R
"5U-nUR
U5nU(a*UVVs/sHupgURPM snnsSSS5 $Ub)W[R
"5-
nUS:aUsSSS5 $Mps snnf!,(df   g=f)r�Nr)�
_WaitSelector�register�	selectors�
EVENT_READrr�select�fileobj)rr�selectorr��deadliner��key�eventss        rrrns����_��"���!�!�#�y�';�';�<�#��"��>�>�+�g�5��� ����0���=B�C�U�M�S�C�K�K�U�C��_��*�"*�T�^�^�-=�"=��"�Q�;�#(��_���D��_�s$�A#C�.C�C�"C�?C�
Cc�*�UR5n[R"U[R[R5nSSKJn URU5n[X@RUR44sSSS5 $!,(df   g=f)Nr)�resource_sharer)rkr4�fromfdr�SOCK_STREAMr$r�	DupSocket�rebuild_connectionrHrI)r�rGrpr�dss     r�reduce_connectionr�s^�������
�]�]�6�6�>�>�6�3E�3E�
F�!�)� �*�*�1�-�B�%��M�M�4�=�=�'I�I�G�
F�
F�s�5B�
Bc�V�UR5n[UR5X5$r�r8r�)rrHrI�socks    rrr�s ���y�y�{���$�+�+�-��<�<rc��UR(a[ROSUR(a[ROS-n[
R"UR5U5n[X RUR44$r�)	rHr��FILE_GENERIC_READrI�FILE_GENERIC_WRITEr�	DupHandlerk�rebuild_pipe_connection)r�rT�dhs   r�reduce_pipe_connectionr'�s\��04�
�
�7�,�,�1�15���7�-�-�A�G��
�
 �
 ������
7��&��]�]�D�M�M�(J�J�Jrc�:�UR5n[X1U5$r)r8r�)r&rHrIrGs    rr%r%�s��������f��9�9rc��[R"UR55n[XRUR
44$r)r�DupFdrkrrHrI)r��dfs  rrr�s.��
�_�_�T�[�[�]�
+��!�B�
�
�t�}�}�#E�E�Erc�:�UR5n[X1U5$rr)r+rHrI�fds    rrr�s��
�Y�Y�[���"��1�1r)NN)T)r�r)V�__all__r�r�r(r1r4r�rr%�	itertoolsr$rr	r
�contextr�ForkingPicklerr~r	r�rr
rr�ImportErrorr2rE�CONNECTION_TIMEOUT�countr+r�familiesr3rrr/r5r=r?r�r��objectrrrrr1rr0r�r�r�r��	frozensetr��maxr�r��_MD5_DIGEST_LENr�rr9r�r�r�rrr�r�r�r�r�r�r��ERROR_NETNAME_DELETEDr�rrr
r�SelectSelectorrrr
r'r%r�rr�<module>r<s���3���	�	�
�
�
�����1���*�*�����O�O��������!�
����;��
�6�9����N�����H��<�<�7���N�����H�-�&� �0�
F�
F�&T�T�n�]��]�@M��M�h;�v�;�|
�*�<�<�7���&&�X)�V�)�X&��<�<�7��6,�v�6,�p!�>��
�
�����r�@�B���7�&6�7�7������*�O�<��2�%�2�S�%�L�2�4?�8?�2(�5�(�*>�%�>�*
��
�H��>�(�>�L��<�<�7���@�.�.��0M�0M�N�M�L>�`�
�y�.�)�)�!�.�.�
�!�0�0�
�)�6�<�<�7��J�=����z�#4�5�K�
:����~�'=�>�F�2����z�#4�5��K$��
�|�|�w��
��G��s�
I�I:�9I:

?>