Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/conch/ssh/__pycache__/forwarding.cpython-39.pyc
Ðазад
a k�h! � @ s� d Z ddlZddlmZmZ ddlmZmZ ddlm Z m Z G dd� dej�ZG dd � d ej �ZG d d� de�ZG dd � d e�ZG dd� dej �Zdd� ZG dd� dej�Zdd� ZeZdd� ZeZdd� Zdd� ZdS )z� This module contains the implementation of the TCP forwarding, which allows clients and servers to forward arbitrary TCP data across the connection. Maintainer: Paul Swartz � N)�channel�common)�protocol�reactor)�HostnameEndpoint�connectProtocolc @ s e Zd Zdd� Zdd� ZdS )�SSHListenForwardingFactoryc C s || _ || _|| _d S �N)�conn�hostport�klass)�self� connectionr r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/conch/ssh/forwarding.py�__init__ s z#SSHListenForwardingFactory.__init__c C sF | j | jd�}t|�}||_|j|jf}t| j|�}| j�||� |S )N)r ) r r �SSHForwardingClient�client�host�port�packOpen_direct_tcpipr ZopenChannel)r �addrr r Z addrTupleZchannelOpenDatar r r � buildProtocol s z(SSHListenForwardingFactory.buildProtocolN)�__name__� __module__�__qualname__r r r r r r r s r c @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdS )�SSHListenForwardingChannelc C sH | j jd| jd� t| jj�dkr<| jjdd � }| �|� d| j_d S )Nzopened forwarding channel {id}��id� � )�_log�infor �lenr �buf�write)r �specificData�br r r �channelOpen$ s z&SSHListenForwardingChannel.channelOpenc C s | � � d S r )�closed�r �reasonr r r � openFailed+ s z%SSHListenForwardingChannel.openFailedc C s | j j�|� d S r )r � transportr% �r �datar r r �dataReceived. s z'SSHListenForwardingChannel.dataReceivedc C s | j j�� d S r )r r- �loseConnection�r r r r �eofReceived1 s z&SSHListenForwardingChannel.eofReceivedc C s0 t | d�r,| jjd| jd� | jj�� | `d S )Nr z%closing local forwarding channel {id}r )�hasattrr! r"