[or-cvs] r13486: Start choosing which bridge to use proportional to its adver (in tor/trunk: . doc src/or)

arma at seul.org arma at seul.org
Tue Feb 12 22:02:48 UTC 2008


Author: arma
Date: 2008-02-12 17:02:47 -0500 (Tue, 12 Feb 2008)
New Revision: 13486

Modified:
   tor/trunk/ChangeLog
   tor/trunk/doc/TODO
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/routerlist.c
Log:
Start choosing which bridge to use proportional to its advertised
bandwidth, rather than uniformly at random. This should speed up Tor
for bridge users. Also do this for people who set StrictEntryNodes.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-02-12 20:42:40 UTC (rev 13485)
+++ tor/trunk/ChangeLog	2008-02-12 22:02:47 UTC (rev 13486)
@@ -1,4 +1,9 @@
 Changes in version 0.2.0.20-?? - 2008-02-??
+  o Major features:
+    - Start choosing which bridge to use proportional to its advertised
+      bandwidth, rather than uniformly at random. This should speed up Tor
+      for bridge users. Also do this for people who set StrictEntryNodes.
+
   o Minor features (performance):
     - Tune parameters for cell pool allocation to minimize amount of
       RAM overhead used.

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2008-02-12 20:42:40 UTC (rev 13485)
+++ tor/trunk/doc/TODO	2008-02-12 22:02:47 UTC (rev 13486)
@@ -127,6 +127,7 @@
 P - create a "make win32-bundle" for vidalia-privoxy-tor-torbutton bundle
 
 Planned for 0.2.1.x:
+  - router_choose_random_node() has a big pile of args. make it "flags".
   - anonymity concern: since our is-consensus-fresh-enough check is
     sloppy so clients will actually work when a consensus wasn't formed,
     does that mean that if users are idle for 5 hours and then click on

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2008-02-12 20:42:40 UTC (rev 13485)
+++ tor/trunk/src/or/circuitbuild.c	2008-02-12 22:02:47 UTC (rev 13486)
@@ -2501,7 +2501,16 @@
   }
 
  choose_and_finish:
-  r = smartlist_choose(live_entry_guards);
+  if (entry_list_can_grow(options)) {
+    /* We choose uniformly at random here, because choose_good_entry_server()
+     * already weights its choices by bandwidth, so we don't want to
+     * *double*-weight our guard selection. */
+    r = smartlist_choose(live_entry_guards);
+  } else {
+    /* We need to weight by bandwidth, because our bridges or entryguards
+     * were not already selected proportional to their bandwidth. */
+    r = routerlist_sl_choose_by_bandwidth(live_entry_guards, WEIGHT_FOR_GUARD);
+  }
   smartlist_free(live_entry_guards);
   smartlist_free(exit_family);
   return r;

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2008-02-12 20:42:40 UTC (rev 13485)
+++ tor/trunk/src/or/routerlist.c	2008-02-12 22:02:47 UTC (rev 13486)
@@ -1393,6 +1393,7 @@
  * If <b>for_guard</b>, we're picking a guard node: consider all guard's
  * bandwidth equally. Otherwise, weight guards proportionally less.
  *
+ * XXX DOCDOC the above args aren't args anymore
  */
 static void *
 smartlist_choose_by_bandwidth(smartlist_t *sl, bandwidth_weight_rule_t rule,



More information about the tor-commits mailing list