summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-18 20:35:11 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-18 20:35:11 +0000
commit2396c6bf71895295e71de805b9e856e68d3336ee (patch)
tree5d669eecbe69ab48b338d98dfe38e24134a56a8f
parent9504db8ce8ff297929cd743acbe5a4f26df8bbd3 (diff)
downloadtor-2396c6bf71895295e71de805b9e856e68d3336ee.tar.gz
tor-2396c6bf71895295e71de805b9e856e68d3336ee.zip
remove last vestiges of this 'twin' concept
svn:r2291
-rw-r--r--src/or/circuitbuild.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index e64d4a9343..9102e490a6 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -246,7 +246,7 @@ circuit_t *circuit_establish_circuit(uint8_t purpose,
* (may already have been) whenever n_conn reaches OR_CONN_STATE_OPEN.
*/
return circ;
- } else { /* it (or a twin) is already open. use it. */
+ } else { /* it's already open. use it. */
circ->n_addr = n_conn->addr;
circ->n_port = n_conn->port;
circ->n_conn = n_conn;
@@ -1015,13 +1015,12 @@ onion_new_cpath_build_state(uint8_t purpose, const char *exit_digest)
}
/** Return the number of routers in <b>routers</b> that are currently up
- * and available for building circuits through. Count sets of twins only
- * once.
+ * and available for building circuits through.
*/
static int count_acceptable_routers(smartlist_t *routers) {
- int i, j, n;
+ int i, n;
int num=0;
- routerinfo_t *r, *r2;
+ routerinfo_t *r;
n = smartlist_len(routers);
for(i=0;i<n;i++) {
@@ -1036,14 +1035,6 @@ static int count_acceptable_routers(smartlist_t *routers) {
log_fn(LOG_DEBUG,"Nope, the directory says %d is not verified.",i);
goto next_i_loop; /* XXX008 */
}
- for(j=0;j<i;j++) {
- r2 = smartlist_get(routers, j);
- if(!crypto_pk_cmp_keys(r->onion_pkey, r2->onion_pkey)) {
- /* these guys are twins. so we've already counted him. */
- log_fn(LOG_DEBUG,"Nope, %d is a twin of %d.",i,j);
- goto next_i_loop;
- }
- }
num++;
log_fn(LOG_DEBUG,"I like %d. num_acceptable_routers now %d.",i, num);
next_i_loop:
@@ -1053,26 +1044,6 @@ static int count_acceptable_routers(smartlist_t *routers) {
return num;
}
-#if 0
-/** Go through smartlist <b>sl</b> of routers, and remove all elements that
- * have the same onion key as twin.
- */
-static void remove_twins_from_smartlist(smartlist_t *sl, routerinfo_t *twin) {
- int i;
- routerinfo_t *r;
-
- if(twin == NULL)
- return;
-
- for(i=0; i < smartlist_len(sl); i++) {
- r = smartlist_get(sl,i);
- if (!crypto_pk_cmp_keys(r->onion_pkey, twin->onion_pkey)) {
- smartlist_del(sl,i--);
- }
- }
-}
-#endif
-
/** Add <b>new_hop</b> to the end of the doubly-linked-list <b>head_ptr</b>.
*
* This function is used to extend cpath by another hop.