]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
make servers tolerate the dns bug.
authorRoger Dingledine <arma@torproject.org>
Sat, 5 Apr 2003 19:53:45 +0000 (19:53 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 5 Apr 2003 19:53:45 +0000 (19:53 +0000)
svn:r223

src/or/dns.c

index 362afce16d903a39e63c662a57fdb33fd1022178..0de83775f5f7cb71b017364233f6573251589eef 100644 (file)
@@ -540,7 +540,15 @@ static int dns_found_answer(char *question, uint32_t answer, uint32_t valid) {
     return 0;
   }
 
-  assert(resolve->state == CACHE_STATE_PENDING);
+//  assert(resolve->state == CACHE_STATE_PENDING);
+  /* XXX this is a bug which hasn't been found yet. Probably something
+   * about slaves answering questions when they're not supposed to, and
+   * reusing the old question.
+   */
+  if(resolve->state != CACHE_STATE_PENDING) {
+    log(LOG_ERR,"dns_found_answer(): BUG: resolve '%s' in state %d (not pending). Dropping.",question, resolve->state);
+    return 0;
+  }
 
   resolve->answer = ntohl(answer);
   if(valid)