aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-10-14 06:44:48 +0000
committerRoger Dingledine <arma@torproject.org>2002-10-14 06:44:48 +0000
commit121d029584d5f500b0d9d2c808c28645cf4937f5 (patch)
tree23099cdbf1aac77aec20d9669f2139a0ebc5d372
parent84a34edfa1490a1503b8d7fc9e0a95f9bcd2a175 (diff)
downloadtor-121d029584d5f500b0d9d2c808c28645cf4937f5.tar.gz
tor-121d029584d5f500b0d9d2c808c28645cf4937f5.zip
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. svn:r135
-rw-r--r--src/or/directory.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index fb87be00a4..11bd901814 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -37,7 +37,8 @@ void directory_initiate_fetch(routerinfo_t *router) {
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_create_listener(struct sockaddr_in *bindaddr) {
}
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);
}