diff options
author | Roger Dingledine <arma@torproject.org> | 2007-06-15 06:01:04 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-06-15 06:01:04 +0000 |
commit | 2cd293dc8f447d9b96590c92d2ef00458c3996a2 (patch) | |
tree | e154736479ba230f7ee09deb8ba5ffa04d59cdad /src/or/circuitlist.c | |
parent | 6a2f045163e7583fd41318cd8f0e4d321c937fee (diff) | |
download | tor-2cd293dc8f447d9b96590c92d2ef00458c3996a2.tar.gz tor-2cd293dc8f447d9b96590c92d2ef00458c3996a2.zip |
now we can specify a bridge without specifying its key,
and we will still connect to it and use it. getting closer!
svn:r10609
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r-- | src/or/circuitlist.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 4b455e958f..b668d298c6 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -218,7 +218,7 @@ circuit_add(circuit_t *circ) } } -/** Append to <b>out</b> the number of circuits in state OR_WAIT, waiting for +/** Append to <b>out</b> all circuits in state OR_WAIT waiting for * the given connection. */ void circuit_get_all_pending_on_or_conn(smartlist_t *out, or_connection_t *or_conn) @@ -234,11 +234,18 @@ circuit_get_all_pending_on_or_conn(smartlist_t *out, or_connection_t *or_conn) if (circ->marked_for_close) continue; tor_assert(circ->state == CIRCUIT_STATE_OR_WAIT); - if (!circ->n_conn && - !memcmp(or_conn->identity_digest, circ->n_conn_id_digest, - DIGEST_LEN)) { - smartlist_add(out, circ); + if (tor_digest_is_zero(circ->n_conn_id_digest)) { + /* Look at addr/port. This is an unkeyed connection. */ + if (circ->n_addr != or_conn->_base.addr || + circ->n_port != or_conn->_base.port) + continue; + } else { + /* We expected a key. See if it's the right one. */ + if (memcmp(or_conn->identity_digest, + circ->n_conn_id_digest, DIGEST_LEN)) + continue; } + smartlist_add(out, circ); }); } |