diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-08-14 20:16:21 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-08-14 20:16:21 +0000 |
commit | a5c0aa43a082f7a15a15566e839aca18ff046381 (patch) | |
tree | 63a93a6691ff7c2540906275b5919a8cad1c1bbe | |
parent | 628089b1f88f4775dd7214d4ca719585f04ef5f5 (diff) | |
download | tor-a5c0aa43a082f7a15a15566e839aca18ff046381.tar.gz tor-a5c0aa43a082f7a15a15566e839aca18ff046381.zip |
r7383@Kushana: nickm | 2006-08-14 16:16:03 -0400
Stop walking entire dns cache for every request, now that we found our hash table bug.
svn:r7057
-rw-r--r-- | src/or/dns.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index c5ef7befe3..e868b1207a 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -107,7 +107,12 @@ static int spawn_enough_dnsworkers(void); #else static void configure_nameservers(void); #endif -static void assert_cache_ok(void); +static void _assert_cache_ok(void); +#ifdef DEBUG_DNS_CACHE +#define assert_cache_ok() _assert_cache_ok() +#else +#define assert_cache_ok() do {} while(0) +#endif static void assert_resolve_ok(cached_resolve_t *resolve); /** Hash table of cached_resolve objects. */ @@ -1285,7 +1290,7 @@ assert_resolve_ok(cached_resolve_t *resolve) } static void -assert_cache_ok(void) +_assert_cache_ok(void) { cached_resolve_t **resolve; int bad_rep = _cache_map_HT_REP_IS_BAD(&cache_root); |