]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
add a log_warn to notify us of yet another potential dns.c bug
authorRoger Dingledine <arma@torproject.org>
Sat, 28 Feb 2004 22:13:58 +0000 (22:13 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 28 Feb 2004 22:13:58 +0000 (22:13 +0000)
svn:r1167

src/or/dns.c

index c05fcbd32afd6310a419a8c80628306932a4c5aa..7c1d58c1ce3f5691d13e126e692fbeb863e83370 100644 (file)
@@ -76,6 +76,12 @@ static void purge_expired_resolves(uint32_t now) {
   while(oldest_cached_resolve && (oldest_cached_resolve->expire < now)) {
     resolve = oldest_cached_resolve;
     log(LOG_DEBUG,"Forgetting old cached resolve (expires %lu)", (unsigned long)resolve->expire);
+    if(resolve->state == CACHE_STATE_PENDING) {
+      log_fn(LOG_WARN,"Expiring a dns resolve that's still pending. Forgot to cull it?");
+      /* XXX if resolve->pending_connections is used, then we're probably
+       * introducing bugs by closing resolve without notifying those streams.
+       */
+    }
     oldest_cached_resolve = resolve->next;
     if(!oldest_cached_resolve) /* if there are no more, */
       newest_cached_resolve = NULL; /* then make sure the list's tail knows that too */