[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] bugfix: don"t pass complex things to the connection_mark_fo...
- To: or-cvs@freehaven.net
- Subject: [or-cvs] bugfix: don"t pass complex things to the connection_mark_fo...
- From: arma@seul.org (Roger Dingledine)
- Date: Thu, 4 Mar 2004 15:49:40 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Thu, 04 Mar 2004 15:49:58 -0500
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or
Modified Files:
dns.c
Log Message:
bugfix: don't pass complex things to the connection_mark_for_close macro
Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dns.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- dns.c 4 Mar 2004 18:43:44 -0000 1.61
+++ dns.c 4 Mar 2004 20:49:38 -0000 1.62
@@ -214,7 +214,7 @@
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 @@
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 @@
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 @@
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 @@
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);
}