]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bugfix: actually remember the answer in the cache :)
authorRoger Dingledine <arma@torproject.org>
Sun, 16 Feb 2003 02:05:24 +0000 (02:05 +0000)
committerRoger Dingledine <arma@torproject.org>
Sun, 16 Feb 2003 02:05:24 +0000 (02:05 +0000)
svn:r159

src/or/dns.c

index fc5575cb417c39d3635aa4c8e62be044a3c26786..d0f65e0ffc6b8bfd88c98e504d5087c30892d690 100644 (file)
@@ -543,6 +543,7 @@ static int dns_found_answer(char *question, uint32_t answer, uint32_t valid) {
 
   assert(resolve->state == CACHE_STATE_PENDING);
 
+  resolve->answer = ntohl(answer);
   if(valid)
     resolve->state = CACHE_STATE_VALID;
   else
@@ -550,7 +551,7 @@ static int dns_found_answer(char *question, uint32_t answer, uint32_t valid) {
 
   while(resolve->pending_connections) {
     pend = resolve->pending_connections;
-    pend->conn->addr = ntohl(answer);
+    pend->conn->addr = resolve->answer;
     if(resolve->state == CACHE_STATE_FAILED || connection_exit_connect(pend->conn) < 0) {
       pend->conn->marked_for_close = 1;
     }