diff options
author | Roger Dingledine <arma@torproject.org> | 2004-08-08 10:32:36 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-08-08 10:32:36 +0000 |
commit | b2c7b5adfb5f085c298d32b67727f70720b2ac2b (patch) | |
tree | a7aec1ac8c1c454a5c930aea6ef26b0aaa89e49f /src/or/connection_or.c | |
parent | 05790d17225f5ba71d378f49c52cba7ed20d43ee (diff) | |
download | tor-b2c7b5adfb5f085c298d32b67727f70720b2ac2b.tar.gz tor-b2c7b5adfb5f085c298d32b67727f70720b2ac2b.zip |
fix a race condition in 008pre2: don't try to extend onto a connection
that's still handshaking.
for servers in clique mode, require the conn to be open before you'll
choose it for your path.
svn:r2198
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 1648b02ebe..43cdb682f5 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -168,8 +168,11 @@ connection_t *connection_or_connect(uint32_t addr, uint16_t port, /* this function should never be called if we're already connected to * id_digest, but check first to be sure */ conn = connection_get_by_identity_digest(id_digest, CONN_TYPE_OR); - if(conn) + if(conn) { + tor_assert(conn->nickname); + log_fn(LOG_WARN,"Asked me to connect to %s, but there's already a connection.", conn->nickname); return conn; + } conn = connection_new(CONN_TYPE_OR); |