aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/or/dns.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 037805a9e8..0bcd021e93 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -839,9 +839,19 @@ 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.",
+ if (!resolve)
+ return;
+
+ if (resolve->state != CACHE_STATE_PENDING) {
+ /* We can get into this state if we never actually created the pending
+ * resolve, due to finding an earlier cached error or something. Just
+ * ignore it. */
+ if (resolve->pending_connections) {
+ log_warn(LD_BUG,
+ "Address %s is not pending but has pending connections!",
escaped_safe_str(address));
+ tor_fragile_assert();
+ }
return;
}