Ë
    zñ�j(  ã                   ó¢   — d dl Z d dlZd dlZd dlmZ d dlZd dlZd\  ZZ	 d dlZd dl
mZ d dlmZ  G d„ de«      Zy# e$ rZ	e	ZY dZ	[	Œ$dZ	[	ww xY w)é    N)Úselect)NN)ÚProxyCommandFailure)ÚClosingContextManagerc                   óN   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zed„ «       Z	ed„ «       Z
d„ Zy	)
ÚProxyCommandaª  
    Wraps a subprocess running ProxyCommand-driven programs.

    This class implements a the socket-like interface needed by the
    `.Transport` and `.Packetizer` classes. Using this class instead of a
    regular socket makes it possible to talk with a Popen'd command that will
    proxy traffic between the client and a server hosted in another machine.

    Instances of this class may be used as context managers.
    c                 ó  — t         €t        ‚t        j                  |«      | _        t        j
                  | j                  t         j                  t         j                  t         j                  d¬«      | _        d| _        y)a  
        Create a new CommandProxy instance. The instance created by this
        class can be passed as an argument to the `.Transport` class.

        :param str command_line:
            the command that should be executed and used as the proxy.
        Nr   )ÚstdinÚstdoutÚstderrÚbufsize)	Ú
subprocessÚsubprocess_import_errorÚshlexÚsplitÚcmdÚPopenÚPIPEÚprocessÚtimeout)ÚselfÚcommand_lines     úO/var/www/api.ozpay.ru/ozpay/venv/lib/python3.12/site-packages/paramiko/proxy.pyÚ__init__zProxyCommand.__init__3   sZ   € ô ÐÜ)Ð)Ü—;‘;˜|Ó,ˆŒÜ!×'Ñ'Ø�H‰HÜ—/‘/Ü—?‘?Ü—?‘?Øô
ˆŒð ˆ�ó    c                 óä   — 	 | j                   j                  j                  |«       t        |«      S # t        $ r4}t	        dj                  | j                  «      |j                  «      ‚d}~ww xY w)zº
        Write the content received from the SSH client to the standard
        input of the forked command.

        :param str content: string to be sent to the forked command
        ú N)	r   r	   ÚwriteÚIOErrorr   Újoinr   ÚstrerrorÚlen)r   ÚcontentÚes      r   ÚsendzProxyCommand.sendG   s`   € ð	FØ�L‰L×Ñ×$Ñ$ WÔ-ô �7‹|Ðøô ò 	Fô
 & c§h¡h¨t¯x©xÓ&8¸!¿*¹*ÓEÐEûð	Fús   ‚%2 ²	A/»/A*Á*A/c                 óæ  — 	 d}t        j                   «       }t        |«      |k  ròd}| j                  �It        j                   «       |z
  }|| j                  k\  rt        j                  «       ‚| j                  |z
  }t	        | j
                  j                  gg g |«      \  }}}|rc|d   | j
                  j                  k(  rG|t        j                  | j
                  j                  j                  «       |t        |«      z
  «      z  }t        |«      |k  rŒò|S # t        j                  $ r r|cY S ‚ t        $ r4}	t        dj                  | j                  «      |	j                  «      ‚d}	~	ww xY w)zÎ
        Read from the standard output of the forked program.

        :param int size: how many chars should be read

        :return: the string of bytes read, which may be shorter than requested
        r   Nr   r   )Útimer!   r   Úsocketr   r   r
   ÚosÚreadÚfilenor   r   r   r   r    )
r   ÚsizeÚbufferÚstartÚselect_timeoutÚelapsedÚrÚwÚxr#   s
             r   ÚrecvzProxyCommand.recvX   s7  € ð	FØˆFÜ—I‘I“KˆEÜ�f“+ Ò$Ø!%�Ø—<‘<Ð+Ü"Ÿi™i›k¨EÑ1�GØ $§,¡,Ò.Ü$Ÿn™nÓ.Ð.Ø%)§\¡\°GÑ%;�Nä  $§,¡,×"5Ñ"5Ð!6¸¸BÀÓO‘��1�aÙ˜˜1™ §¡×!4Ñ!4Ò4ØœbŸg™gØŸ™×+Ñ+×2Ñ2Ó4°d¼SÀ»[Ñ6Hóñ �Fô �f“+ Ó$ð ˆMøÜ�~‰~ò 	Ùà’ØÜò 	FÜ% c§h¡h¨t¯x©xÓ&8¸!¿*¹*ÓEÐEûð	Fús$   ‚DD ÄD ÄE0Ä3	E0Ä</E+Å+E0c                 ót   — t        j                  | j                  j                  t        j
                  «       y ©N)r(   Úkillr   ÚpidÚsignalÚSIGTERM©r   s    r   ÚclosezProxyCommand.closey   s   € Ü
�‰�—‘× Ñ ¤&§.¡.Õ1r   c                 ó2   — | j                   j                  d uS r5   )r   Ú
returncoder:   s    r   ÚclosedzProxyCommand.closed|   s   € à�|‰|×&Ñ&¨dÐ2Ð2r   c                 ó   — | j                   S r5   )r>   r:   s    r   Ú_closedzProxyCommand._closed€   s   € ð �{‰{Ðr   c                 ó   — || _         y r5   )r   )r   r   s     r   Ú
settimeoutzProxyCommand.settimeout…   s	   € Øˆ�r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   r3   r;   Úpropertyr>   r@   rB   © r   r   r   r   '   sJ   „ ñ	òò(ò"FòB2ð ñ3ó ð3ð ñó ðór   r   )r(   r   r8   r   r'   r&   r   r   ÚImportErrorr#   Úparamiko.ssh_exceptionr   Úparamiko.utilr   r   rH   r   r   ú<module>rL      s]   ðó( 
Û Û Ý Û Û ð '1Ñ #€
Ð#ð Ûõ 7Ý /ô_Ð(õ _øð ò  ØÕûð ús   ¡= ½AÁA	Á	A