[or-cvs] r9467: Fix a bug in our assertions related to removing recently-com (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Jan 30 22:44:26 UTC 2007


Author: nickm
Date: 2007-01-30 17:44:24 -0500 (Tue, 30 Jan 2007)
New Revision: 9467

Modified:
   tor/trunk/
   tor/trunk/src/or/dns.c
Log:
 r11610 at catbus:  nickm | 2007-01-30 17:44:02 -0500
 Fix a bug in our assertions related to removing recently-completed DNS lookup attempts on exit.  It is okay to find a cache entry with the same name as a DONE entry, so long it is not the same struct as the DONE entry.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11610] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/dns.c
===================================================================
--- tor/trunk/src/or/dns.c	2007-01-30 22:19:41 UTC (rev 9466)
+++ tor/trunk/src/or/dns.c	2007-01-30 22:44:24 UTC (rev 9467)
@@ -324,8 +324,8 @@
         /* XXXX012 The hash lookups here could be quite slow; remove them
          * once we're happy. */
         if (res->state == CACHE_STATE_DONE) {
-          cached_resolve_t *removed = HT_REMOVE(cache_map, &cache_root, res);
-          tor_assert(!removed);
+          cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res);
+          tor_assert(!found || found != res);
           _free_cached_resolve(res);
         } else {
           cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res);



More information about the tor-commits mailing list