]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Cosmetic patch for arma's fix for The Bug: Don't set the state to
authorNick Mathewson <nickm@torproject.org>
Sun, 11 Apr 2004 17:07:45 +0000 (17:07 +0000)
committerNick Mathewson <nickm@torproject.org>
Sun, 11 Apr 2004 17:07:45 +0000 (17:07 +0000)
RESOLVEFAILED if the resolve didn't fail; set it to CONNECTING
instead.

svn:r1590

src/or/dns.c

index fad3af1a5266a935c8e02def1df9c25adeb7b936..cfa3956109db9e3cfadadde9c9143f6149f7400d 100644 (file)
@@ -378,14 +378,16 @@ static void dns_found_answer(char *address, uint32_t addr, char outcome) {
     assert_connection_ok(pend->conn,time(NULL));
     pend->conn->addr = resolve->addr;
 
-    /* prevent double-remove. (this may get changed below.) */
-    pend->conn->state = EXIT_CONN_STATE_RESOLVEFAILED;
 
     if(resolve->state == CACHE_STATE_FAILED) {
       pendconn = pend->conn; /* don't pass complex things to the
                                 connection_mark_for_close macro */
+      /* prevent double-remove. */
+      pend->conn->state = EXIT_CONN_STATE_RESOLVEFAILED;
       connection_mark_for_close(pendconn, END_STREAM_REASON_RESOLVEFAILED);
     } else {
+      /* prevent double-remove. */
+      pend->conn->state = EXIT_CONN_STATE_CONNECTING;
       connection_exit_connect(pend->conn);
     }
     resolve->pending_connections = pend->next;