[or-cvs] when canceling a dns query after we run out of dnsworkers o...
Roger Dingledine
arma at seul.org
Fri Jan 28 06:01:02 UTC 2005
Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/0091/tor/src/or
Modified Files:
Tag: tor-0_0_9-patches
dns.c
Log Message:
when canceling a dns query after we run out of dnsworkers or fds,
it's possible that we haven't attached it to the circuit yet, so
don't assume we did.
Index: dns.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dns.c,v
retrieving revision 1.126.2.4
retrieving revision 1.126.2.5
diff -u -d -r1.126.2.4 -r1.126.2.5
--- dns.c 28 Jan 2005 05:59:18 -0000 1.126.2.4
+++ dns.c 28 Jan 2005 06:01:00 -0000 1.126.2.5
@@ -388,6 +388,7 @@
struct cached_resolve search;
struct cached_resolve *resolve;
connection_t *pendconn;
+ circuit_t *circ;
strlcpy(search.address, address, sizeof(search.address));
@@ -415,7 +416,9 @@
if (!pendconn->marked_for_close) {
connection_edge_end(pendconn, END_STREAM_REASON_MISC, pendconn->cpath_layer);
}
- circuit_detach_stream(circuit_get_by_conn(pendconn), pendconn);
+ circ = circuit_get_by_conn(pendconn);
+ if (circ)
+ circuit_detach_stream(circ, pendconn);
connection_free(pendconn);
resolve->pending_connections = pend->next;
tor_free(pend);
More information about the tor-commits
mailing list