浏览代码

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

Nick Mathewson 19 年之前
父节点
当前提交
a5c0aa43a0
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/or/dns.c

+ 7 - 2
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);