[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] avoid infinite loop in tor-resolve if tor hangs up on it
- To: or-cvs@freehaven.net
- Subject: [or-cvs] avoid infinite loop in tor-resolve if tor hangs up on it
- From: arma@seul.org (Roger Dingledine)
- Date: Wed, 24 Nov 2004 02:45:51 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Wed, 24 Nov 2004 02:46:15 -0500
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home2/or/cvsroot/tor/src/tools
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/tools
Modified Files:
tor-resolve.c
Log Message:
avoid infinite loop in tor-resolve if tor hangs up on it
Index: tor-resolve.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/tools/tor-resolve.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- tor-resolve.c 14 Nov 2004 18:14:15 -0000 1.6
+++ tor-resolve.c 24 Nov 2004 07:45:42 -0000 1.7
@@ -137,6 +137,10 @@
len = 0;
while (len < RESPONSE_LEN) {
r = recv(s, response_buf+len, RESPONSE_LEN-len, 0);
+ if (r==0) {
+ log_fn(LOG_WARN,"EOF while reading SOCKS response");
+ return -1;
+ }
if (r<0) {
log_sock_error("reading SOCKS response", s);
return -1;