aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@torproject.org>2013-06-05 15:48:57 +0200
committerLinus Nordberg <linus@torproject.org>2013-06-18 13:57:27 +0200
commit2b948b5631ba6c5acfc381050520dc32dfac9a2e (patch)
tree9d5bc16a590d883fcd3d981297e52c9e6cc108f0
parent69301e1cb215576ff116b285f9098c243d1eeaf5 (diff)
downloadchutney-2b948b5631ba6c5acfc381050520dc32dfac9a2e.tar
chutney-2b948b5631ba6c5acfc381050520dc32dfac9a2e.tar.gz
Return 1 from Source.on_readable() when connected over proxy.
We used to return 8 by accident (8 minus length of emptied inbuf). This is more explicit.
-rw-r--r--lib/chutney/Traffic.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chutney/Traffic.py b/lib/chutney/Traffic.py
index ab9a578..7202c3d 100644
--- a/lib/chutney/Traffic.py
+++ b/lib/chutney/Traffic.py
@@ -185,11 +185,13 @@ class Source(Peer):
self.inbuf = ''
self.outbuf = self.data
debug("successfully connected (fd=%d)" % self.fd())
+ return 1 # Keep us around for writing.
else:
debug("proxy handshake failed (0x%x)! (fd=%d)" %
(ord(self.inbuf[1]), self.fd()))
self.state = self.NOT_CONNECTED
return -1
+ assert(8 - len(self.inbuf) > 0)
return 8 - len(self.inbuf)
return 1 # Keep us around for writing.