From ceb65ed55fe3f1ccf0d4866c6562736684566f96 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Tue, 19 Feb 2008 21:59:38 -0800 Subject: [PATCH] [project @ robey@lag.net-20080220055938-c772bcrnw9lm2kcd] for forwarded-tcpip connections, stuff the origin_addr in a public field in the Channel, in case recipients find it useful info. --- paramiko/channel.py | 1 + paramiko/transport.py | 1 + 2 files changed, 2 insertions(+) diff --git a/paramiko/channel.py b/paramiko/channel.py index 133a2fb..c1a2652 100644 --- a/paramiko/channel.py +++ b/paramiko/channel.py @@ -92,6 +92,7 @@ class Channel (object): self.event = threading.Event() self.combine_stderr = False self.exit_status = -1 + self.origin_addr = None def __del__(self): try: diff --git a/paramiko/transport.py b/paramiko/transport.py index 68c6d93..4ceb4a0 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -1987,6 +1987,7 @@ class Transport (threading.Thread): if kind == 'x11': self._x11_handler(chan, (origin_addr, origin_port)) elif kind == 'forwarded-tcpip': + chan.origin_addr = (origin_addr, origin_port) self._tcp_handler(chan, (origin_addr, origin_port), (server_addr, server_port)) else: self._queue_incoming_channel(chan)