diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/tor_resolve | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/tor_resolve b/contrib/tor_resolve index 8242916df4..31b44af9d4 100755 --- a/contrib/tor_resolve +++ b/contrib/tor_resolve @@ -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) |