diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-07-20 21:05:05 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-07-20 21:05:05 +0000 |
commit | 6d53717215bb6c47b277a46060fb52e92d297a45 (patch) | |
tree | a120fef52c651cc89566ade9af1d0a3d1de4180b /contrib | |
parent | e57698cc6e3a675702f8c91c669b56f14f478edd (diff) | |
download | tor-6d53717215bb6c47b277a46060fb52e92d297a45.tar.gz tor-6d53717215bb6c47b277a46060fb52e92d297a45.zip |
Handle closed connection properly on tor_resolve
svn:r2066
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) |