HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/paramiko/__pycache__/pipe.cpython-310.pyc
o

�h>�@sZdZddlZddlZddlZdd�ZGdd�d�ZGdd�d�ZGd	d
�d
�Zdd�ZdS)
a
Abstraction of a one-way pipe where the read end can be used in
`select.select`. Normally this is trivial, but Windows makes it nearly
impossible.

The pipe acts like an Event, which can be set or cleared. When set, the pipe
will trigger as readable in `select <select.select>`.
�NcCs&tjdd�dkrt�}|St�}|S)N��win)�sys�platform�	PosixPipe�WindowsPipe)�p�r	�C/usr/local/CyberPanel/lib/python3.10/site-packages/paramiko/pipe.py�	make_pipe!s
�rc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCs&t��\|_|_d|_d|_d|_dS�NF)�os�pipe�_rfd�_wfd�_set�_forever�_closed��selfr	r	r
�__init__*s
zPosixPipe.__init__cCs"t�|j�t�|j�d|_dS�NT)r
�closerrrrr	r	r
r0s
zPosixPipe.closecCs|jS�N)rrr	r	r
�fileno6szPosixPipe.filenocCs(|jr|jrdSt�|jd�d|_dS�N�F)rrr
�readrrr	r	r
�clear9s
zPosixPipe.clearcCs(|js|jrdSd|_t�|jd�dS�NT�*)rrr
�writerrr	r	r
�set?sz
PosixPipe.setcC�d|_|��dSr�rr"rr	r	r
�set_foreverE�zPosixPipe.set_foreverN)	�__name__�
__module__�__qualname__rrrrr"r%r	r	r	r
r)src@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rz�
    On Windows, only an OS-level "WinSock" may be used in select(), but reads
    and writes must be to the actual socket object.
    cCszt�tjtj�}|�d�|�d�t�tjtj�|_|j�d|��df�|��\|_	}|�
�d|_d|_d|_
dS)N)�	127.0.0.1rrr*F)�socket�AF_INET�SOCK_STREAM�bind�listen�_rsock�connect�getsockname�accept�_wsockrrrr)r�serv�addrr	r	r
rPs


zWindowsPipe.__init__cCs|j��|j��d|_dSr)r0rr4rrr	r	r
r_s


zWindowsPipe.closecCs
|j��Sr)r0rrr	r	r
res
zWindowsPipe.filenocCs&|jr|jrdS|j�d�d|_dSr)rrr0�recvrr	r	r
rhs
zWindowsPipe.clearcCs&|js|jrdSd|_|j�d�dSr)rrr4�sendrr	r	r
r"nszWindowsPipe.setcCr#rr$rr	r	r
r%tr&zWindowsPipe.set_foreverN)
r'r(r)�__doc__rrrrr"r%r	r	r	r
rJsrc@s$eZdZdd�Zdd�Zdd�ZdS)�OrPipecCsd|_d|_||_dSr)r�_partner�_pipe)rrr	r	r
rzs
zOrPipe.__init__cC� d|_|jjs|j��dSdSr)rr;r<r"rr	r	r
r"��z
OrPipe.setcCr=r)rr;r<rrr	r	r
r�r>zOrPipe.clearN)r'r(r)rr"rr	r	r	r
r:ysr:cCs$t|�}t|�}||_||_||fS)z�
    wraps a pipe into two pipe-like objects which are "or"d together to
    affect the real pipe. if either returned pipe is set, the wrapped pipe
    is set. when both are cleared, the wrapped pipe is cleared.
    )r:r;)r�p1�p2r	r	r
�make_or_pipe�s
rA)	r9rr
r+rrrr:rAr	r	r	r
�<module>s	!/