diff options
author | Roger Dingledine <arma@torproject.org> | 2007-07-17 02:53:17 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-07-17 02:53:17 +0000 |
commit | ccfda2e3a32e180598d9b6c7f4fe8c3983763b64 (patch) | |
tree | 8ca5e2a722905517f8ccf6069ab32c357ef327a9 /src/or/dns.c | |
parent | ad45ddfb0754ae52bc372fd4fd4867b140765ef5 (diff) | |
download | tor-ccfda2e3a32e180598d9b6c7f4fe8c3983763b64.tar tor-ccfda2e3a32e180598d9b6c7f4fe8c3983763b64.tar.gz |
a few fixes for bug 463. needs a changelog. might need more fixes.
svn:r10849
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index 9bea7f574..4fe497ae0 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -536,8 +536,8 @@ dns_resolve(edge_connection_t *exitconn) r = dns_resolve_impl(exitconn, is_resolve, oncirc, &hostname); switch (r) { case 1: - /* We got an answer without a lookup. (Either the answer was - * cached, or it was obvious (like an IP address).)*/ + /* We got an answer without a lookup -- either the answer was + * cached, or it was obvious (like an IP address). */ if (is_resolve) { /* Send the answer back right now, and detach. */ if (hostname) @@ -562,7 +562,7 @@ dns_resolve(edge_connection_t *exitconn) case -2: case -1: /* The request failed before it could start: cancel this connection, - * and stop everybody waiting forthe same connection. */ + * and stop everybody waiting for the same connection. */ if (is_resolve) { send_resolved_cell(exitconn, (r == -1) ? RESOLVED_TYPE_ERROR : RESOLVED_TYPE_ERROR_TRANSIENT); @@ -578,7 +578,7 @@ dns_resolve(edge_connection_t *exitconn) // If it's marked for close, it's on closeable_connection_lst in // main.c. If it's on the closeable list, it will get freed from // main.c. -NM - // "<armadev> If that's true, there are other bugs arond, where we + // "<armadev> If that's true, there are other bugs around, where we // don't check if it's marked, and will end up double-freeing." } break; @@ -822,9 +822,12 @@ dns_cancel_pending_resolve(const char *address) strlcpy(search.address, address, sizeof(search.address)); resolve = HT_FIND(cache_map, &cache_root, &search); - if (!resolve || resolve->state != CACHE_STATE_PENDING) { - log_notice(LD_BUG,"Address %s is not pending. Dropping.", - escaped_safe_str(address)); + if (!resolve) + return; + + if(resolve->state != CACHE_STATE_PENDING) { + log_notice(LD_BUG,"Address %s is not pending (state %d). Dropping.", + escaped_safe_str(address), resolve->state); return; } |