aboutsummaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-09 21:06:14 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-09 21:06:14 +0000
commit23c193c065cced56ce62bc2090ba133aee1f95b4 (patch)
treedd33451d13e458c2a2fb8b1c862b8572b61f5c6e /src/or/dns.c
parent8f8d185f4b8bf98cb21e99aadc3142e896b8fb1f (diff)
downloadtor-23c193c065cced56ce62bc2090ba133aee1f95b4.tar
tor-23c193c065cced56ce62bc2090ba133aee1f95b4.tar.gz
if dns resolve is valid, but our exit policy rejects it or
the connect attempt fails immediately, we were trying to double-remove it from the dns pending list. i think this might have been The Bug. (thanks weasel!) svn:r1587
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 85676e129..c6b6b373f 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -376,9 +376,9 @@ static void dns_found_answer(char *address, uint32_t addr, char outcome) {
pend = resolve->pending_connections;
assert_connection_ok(pend->conn,time(NULL));
pend->conn->addr = resolve->addr;
+ /* prevent double-remove */
+ pend->conn->state = EXIT_CONN_STATE_RESOLVEFAILED;
if(resolve->state == CACHE_STATE_FAILED) {
- /* prevent double-remove */
- pend->conn->state = EXIT_CONN_STATE_RESOLVEFAILED;
pendconn = pend->conn; /* don't pass complex things to the
connection_mark_for_close macro */
connection_mark_for_close(pendconn, END_STREAM_REASON_RESOLVEFAILED);