]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r7383@Kushana: nickm | 2006-08-14 16:16:03 -0400
authorNick Mathewson <nickm@torproject.org>
Mon, 14 Aug 2006 20:16:21 +0000 (20:16 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 14 Aug 2006 20:16:21 +0000 (20:16 +0000)
 Stop walking entire dns cache for every request, now that we found our hash table bug.

svn:r7057

src/or/dns.c

index c5ef7befe3b53a8f15868b5c92601e4be8ad4049..e868b1207a9c76d3af31589baa7168968da06d10 100644 (file)
@@ -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);