[or-cvs] be safe: if you got a resolvefailed end cell but you"re not...
Roger Dingledine
arma at seul.org
Sun Jan 30 21:46:44 UTC 2005
Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or
Modified Files:
relay.c
Log Message:
be safe: if you got a resolvefailed end cell but you're not an AP, bail.
Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- relay.c 17 Jan 2005 18:13:09 -0000 1.36
+++ relay.c 30 Jan 2005 21:46:42 -0000 1.37
@@ -538,6 +538,10 @@
log_fn(LOG_INFO,"Giving up on retrying (from exitpolicy); conn can't be handled.");
/* else, conn will get closed below */
} else if (rh->length && reason == END_STREAM_REASON_RESOLVEFAILED) {
+ if (conn->type != CONN_TYPE_AP) {
+ log_fn(LOG_WARN,"Got an end because of resolvefailed, but we're not an AP. Closing.");
+ return -1;
+ }
if (client_dns_incr_failures(conn->socks_request->address)
< MAX_RESOLVE_FAILURES) {
/* We haven't retried too many times; reattach the connection. */
More information about the tor-commits
mailing list