[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[or-cvs] fix subtle race condition
Update of /home/or/cvsroot/src/or
In directory moria.seul.org:/home/arma/work/onion/cvs/src/or
Modified Files:
directory.c
Log Message:
fix subtle race condition
If you weren't connected to a given router, and you made a directory
request to it simultaneously with a new web query that caused you to
want to connect to that OR... it would think you're already connected.
Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/src/or/directory.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- directory.c 2 Oct 2002 22:54:20 -0000 1.5
+++ directory.c 14 Oct 2002 06:44:48 -0000 1.6
@@ -37,7 +37,8 @@
return;
/* set up conn so it's got all the data we need to remember */
- conn->addr = router->addr, conn->port = router->or_port; /* NOTE we store or_port here always */
+ conn->addr = router->addr;
+ conn->port = router->dir_port;
conn->address = strdup(router->address);
conn->receiver_bucket = -1; /* edge connections don't do receiver buckets */
conn->bandwidth = -1;
@@ -279,7 +280,7 @@
}
int connection_dir_handle_listener_read(connection_t *conn) {
- log(LOG_NOTICE,"Dir: Received a connection request. Waiting for command.");
+ log(LOG_INFO,"Dir: Received a connection request. Waiting for command.");
return connection_handle_listener_read(conn, CONN_TYPE_DIR, DIR_CONN_STATE_COMMAND_WAIT);
}