diff options
author | Roger Dingledine <arma@torproject.org> | 2004-03-04 20:49:38 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-03-04 20:49:38 +0000 |
commit | 8fe504fee63125082efa34e3790e88bde5b81f01 (patch) | |
tree | 9e628c2698a8841dc395eb48370abdb91ec5bb49 /src/or/dns.c | |
parent | c03e9206ae4953ad425bb56930bec0c570e921d5 (diff) | |
download | tor-8fe504fee63125082efa34e3790e88bde5b81f01.tar.gz tor-8fe504fee63125082efa34e3790e88bde5b81f01.zip |
bugfix: don't pass complex things to the connection_mark_for_close macro
svn:r1231
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index 40f821d732..6fcacfc95b 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -214,7 +214,7 @@ void connection_dns_remove(connection_t *conn) if(pend->conn == conn) { resolve->pending_connections = pend->next; tor_free(pend); - log_fn(LOG_DEBUG, "Connection (fd %d) no longer waiting for resolve of '%s'", + log_fn(LOG_DEBUG, "First connection (fd %d) no longer waiting for resolve of '%s'", conn->s, conn->address); return; } else { @@ -239,6 +239,7 @@ void dns_cancel_pending_resolve(char *address) { struct pending_connection_t *pend; struct cached_resolve search; struct cached_resolve *resolve, *tmp; + connection_t *pendconn; strncpy(search.address, address, MAX_ADDRESSLEN); search.address[MAX_ADDRESSLEN-1] = 0; @@ -258,7 +259,9 @@ void dns_cancel_pending_resolve(char *address) { pend = resolve->pending_connections; /* So that mark_for_close doesn't double-remove the connection. */ pend->conn->state = EXIT_CONN_STATE_RESOLVEFAILED; - connection_mark_for_close(pend->conn, END_STREAM_REASON_MISC); + pendconn = pend->conn; /* don't pass complex things to the + connection_mark_for_close macro */ + connection_mark_for_close(pendconn, END_STREAM_REASON_MISC); resolve->pending_connections = pend->next; tor_free(pend); } @@ -288,6 +291,7 @@ static void dns_found_answer(char *address, uint32_t addr) { struct pending_connection_t *pend; struct cached_resolve search; struct cached_resolve *resolve; + connection_t *pendconn; strncpy(search.address, address, MAX_ADDRESSLEN); search.address[MAX_ADDRESSLEN-1] = 0; @@ -324,7 +328,9 @@ static void dns_found_answer(char *address, uint32_t addr) { if(resolve->state == CACHE_STATE_FAILED) { /* prevent double-remove */ pend->conn->state = EXIT_CONN_STATE_RESOLVEFAILED; - connection_mark_for_close(pend->conn, END_STREAM_REASON_RESOLVEFAILED); + pendconn = pend->conn; /* don't pass complex things to the + connection_mark_for_close macro */ + connection_mark_for_close(pendconn, END_STREAM_REASON_RESOLVEFAILED); } else { connection_exit_connect(pend->conn); } |