diff options
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index fb3620c165..b8dd460889 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -736,15 +736,25 @@ void assert_connection_edge_not_dns_pending(edge_connection_t *conn) { pending_connection_t *pend; - cached_resolve_t **resolve; + cached_resolve_t search; +#if 1 + cached_resolve_t *resolve; + strlcpy(search.address, conn->_base.address, sizeof(search.address)); + resolve = HT_FIND(cache_map, &cache_root, &search); + if (!resolve) + return; + for (pend = resolve->pending_connections; pend; pend = pend->next) { + tor_assert(pend->conn != conn); + } +#else + cached_resolve_t **resolve; HT_FOREACH(resolve, cache_map, &cache_root) { - for (pend = (*resolve)->pending_connections; - pend; - pend = pend->next) { + for (pend = (*resolve)->pending_connections; pend; pend = pend->next) { tor_assert(pend->conn != conn); } } +#endif } /** Log an error and abort if any connection waiting for a DNS resolve is |