mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 10:12:15 +01:00
Handle closed connection properly on tor_resolve
svn:r2066
This commit is contained in:
parent
e57698cc6e
commit
6d53717215
@ -97,7 +97,11 @@ def resolve(hostname, sockshost, socksport, socksver=4):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user