summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonathan Halcrow <jonathan.halcrow@gmail.com>2011-08-29 22:26:14 -0300
committerJeff Forcier <jeff@bitprophet.org>2013-09-20 14:12:32 -0700
commit7ed1e2bccc545d6819f081a12abc854540823e42 (patch)
tree41eba178354fc90f4232c62aaa18f5843e2c728e
parentf7d74d03d9f1f6ec10b0f7df3061384afdb61b48 (diff)
This fixes a Bad file descriptor error caused by attempting to access the request after it has already been closed.
-rw-r--r--demos/forward.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/demos/forward.py b/demos/forward.py
index 4e107855..2a4c4248 100644
--- a/demos/forward.py
+++ b/demos/forward.py
@@ -78,9 +78,11 @@ class Handler (SocketServer.BaseRequestHandler):
if len(data) == 0:
break
self.request.send(data)
+
+ peername = self.request.getpeername()
chan.close()
self.request.close()
- verbose('Tunnel closed from %r' % (self.request.getpeername(),))
+ verbose('Tunnel closed from %r' % (peername,))
def forward_tunnel(local_port, remote_host, remote_port, transport):