aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-08 10:32:36 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-08 10:32:36 +0000
commitb2c7b5adfb5f085c298d32b67727f70720b2ac2b (patch)
treea7aec1ac8c1c454a5c930aea6ef26b0aaa89e49f /src/or/connection.c
parent05790d17225f5ba71d378f49c52cba7ed20d43ee (diff)
downloadtor-b2c7b5adfb5f085c298d32b67727f70720b2ac2b.tar
tor-b2c7b5adfb5f085c298d32b67727f70720b2ac2b.tar.gz
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.c')
-rw-r--r--src/or/connection.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 0d9eb627c..d6291b182 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -978,45 +978,6 @@ connection_t *connection_exact_get_by_addr_port(uint32_t addr, uint16_t port) {
return best;
}
-/** Find a connection to the router described by addr and port,
- * or alternately any router with the same identity key.
- * This connection <em>must</em> be in an "open" state.
- * If not, return NULL.
- */
-/* XXX this twin thing is busted, now that we're rotating onion
- * keys. abandon/patch? */
-connection_t *connection_twin_get_by_addr_port(uint32_t addr, uint16_t port) {
- int i, n;
- connection_t *conn;
- routerinfo_t *router;
- connection_t **carray;
-
- /* first check if it's there exactly */
- conn = connection_exact_get_by_addr_port(addr,port);
- if(conn && connection_state_is_open(conn)) {
- log(LOG_DEBUG,"connection_twin_get_by_addr_port(): Found exact match.");
- return conn;
- }
-
- /* now check if any of the other open connections are a twin for this one */
-
- router = router_get_by_addr_port(addr,port);
- if(!router)
- return NULL;
-
- get_connection_array(&carray,&n);
- for(i=0;i<n;i++) {
- conn = carray[i];
- tor_assert(conn);
- if(connection_state_is_open(conn) &&
- !crypto_pk_cmp_keys(conn->identity_pkey, router->identity_pkey)) {
- log(LOG_DEBUG,"connection_twin_get_by_addr_port(): Found twin (%s).",conn->address);
- return conn;
- }
- }
- return NULL;
-}
-
connection_t *connection_get_by_identity_digest(const char *digest, int type)
{
int i, n;