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 12:59:23 +0200
commitdc66b42be6a19cb5bb31ee1108c7d8a3c769491a (patch)
tree6e0e1a157d0766c943c64429919876e5bc697aa8
parentc987c77d183b462c3b960039abca020ad43b5133 (diff)
downloadchutney-dc66b42be6a19cb5bb31ee1108c7d8a3c769491a.tar
chutney-dc66b42be6a19cb5bb31ee1108c7d8a3c769491a.tar.gz
Report "successfully connected" at most once.
-rw-r--r--lib/chutney/Traffic.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chutney/Traffic.py b/lib/chutney/Traffic.py
index efee8e2..694cd87 100644
--- a/lib/chutney/Traffic.py
+++ b/lib/chutney/Traffic.py
@@ -151,6 +151,7 @@ class Source(Peer):
self.state = self.CONNECTED
self.inbuf = ''
self.outbuf = self.data
+ debug("successfully connected (fd=%d)" % self.fd())
else:
debug("proxy handshake failed (0x%x)! (fd=%d)" %
(ord(self.inbuf[1]), self.fd()))
@@ -171,6 +172,7 @@ class Source(Peer):
if self.proxy is None:
self.state = self.CONNECTED
self.outbuf = self.data
+ debug("successfully connected (fd=%d)" % self.fd())
else:
self.state = self.CONNECTING_THROUGH_PROXY
self.outbuf = socks_cmd(self.dest)
@@ -182,7 +184,6 @@ class Source(Peer):
return -1
raise
self.outbuf = self.outbuf[n:]
- debug("successfully connected (fd=%d)" % self.fd())
if self.state == self.CONNECTING_THROUGH_PROXY:
return 1 # Keep us around.
return len(self.outbuf) # When 0, we're being removed.