[or-cvs] Handle closed connection properly on tor_resolve
Nick Mathewson
nickm at seul.org
Tue Jul 20 21:05:07 UTC 2004
Update of /home/or/cvsroot/contrib
In directory moria.mit.edu:/tmp/cvs-serv8110/contrib
Modified Files:
tor_resolve
Log Message:
Handle closed connection properly on tor_resolve
Index: tor_resolve
===================================================================
RCS file: /home/or/cvsroot/contrib/tor_resolve,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- tor_resolve 17 Jun 2004 18:12:03 -0000 1.1
+++ tor_resolve 20 Jul 2004 21:05:05 -0000 1.2
@@ -97,7 +97,11 @@
answer = s.recv(8)
result = parse(answer)
while result is None:
- answer += s.recv(1)
+ more = s.recv(1)
+ if not more:
+ print "Connection closed; dying."
+ return None
+ answer += more
result = parse(answer)
print "Got answer",result
m = s.recv(1)
More information about the tor-commits
mailing list