remove last vestiges of this 'twin' concept

svn:r2291
This commit is contained in:
Roger Dingledine 2004-08-18 20:35:11 +00:00
parent 9504db8ce8
commit 2396c6bf71

View File

@ -246,7 +246,7 @@ circuit_t *circuit_establish_circuit(uint8_t purpose,
* (may already have been) whenever n_conn reaches OR_CONN_STATE_OPEN. * (may already have been) whenever n_conn reaches OR_CONN_STATE_OPEN.
*/ */
return circ; 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_addr = n_conn->addr;
circ->n_port = n_conn->port; circ->n_port = n_conn->port;
circ->n_conn = n_conn; 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 /** Return the number of routers in <b>routers</b> that are currently up
* and available for building circuits through. Count sets of twins only * and available for building circuits through.
* once.
*/ */
static int count_acceptable_routers(smartlist_t *routers) { static int count_acceptable_routers(smartlist_t *routers) {
int i, j, n; int i, n;
int num=0; int num=0;
routerinfo_t *r, *r2; routerinfo_t *r;
n = smartlist_len(routers); n = smartlist_len(routers);
for(i=0;i<n;i++) { 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); log_fn(LOG_DEBUG,"Nope, the directory says %d is not verified.",i);
goto next_i_loop; /* XXX008 */ 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++; num++;
log_fn(LOG_DEBUG,"I like %d. num_acceptable_routers now %d.",i, num); log_fn(LOG_DEBUG,"I like %d. num_acceptable_routers now %d.",i, num);
next_i_loop: next_i_loop:
@ -1053,26 +1044,6 @@ static int count_acceptable_routers(smartlist_t *routers) {
return num; 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>. /** 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. * This function is used to extend cpath by another hop.