diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-06-04 03:31:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-06-04 03:31:12 -0400 |
commit | 4945fee65a406e0f95f451909c4848b4387ecf4a (patch) | |
tree | 476557cdbc95f7cbce0cf1bc8c822330cc06b8b0 /src/or/dns.c | |
parent | 77ffd6b2a7bb8450c033763e2eb4d7f0ed7a5757 (diff) | |
parent | 48bf1d97eeed9fd0812e281cbc1f08c6c5ade89c (diff) | |
download | tor-4945fee65a406e0f95f451909c4848b4387ecf4a.tar.gz tor-4945fee65a406e0f95f451909c4848b4387ecf4a.zip |
Merge commit 'origin/maint-0.2.1'
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 |