[or-cvs] remove last vestiges of this "twin" concept

Roger Dingledine arma at seul.org
Wed Aug 18 20:35:14 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	circuitbuild.c 
Log Message:
remove last vestiges of this 'twin' concept


Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitbuild.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- circuitbuild.c	18 Aug 2004 11:20:15 -0000	1.31
+++ circuitbuild.c	18 Aug 2004 20:35:11 -0000	1.32
@@ -246,7 +246,7 @@
      * (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 @@
 }
 
 /** 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 @@
       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 @@
   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.



More information about the tor-commits mailing list