[or-cvs] r10730: If there's a never-before-connected-to guard node in our lis (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Mon Jul 2 22:15:27 UTC 2007


Author: arma
Date: 2007-07-02 18:15:26 -0400 (Mon, 02 Jul 2007)
New Revision: 10730

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuitbuild.c
Log:
If there's a never-before-connected-to guard node in our list,
never choose any guards past it. This way we don't expand our 
guard list unless we need to. [Bugfix in 0.1.2.x]

I'm not sure if this will solve all our problems, but it is at least
something.



Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-07-02 22:07:53 UTC (rev 10729)
+++ tor/trunk/ChangeLog	2007-07-02 22:15:26 UTC (rev 10730)
@@ -50,7 +50,12 @@
     - Stop under-counting the number of authorities that recommend each
       version. [Bugfix on 0.1.2.x]
 
+  o Minor bugfixes (guard nodes):
+    - If there's a never-before-connected-to guard node in our list,
+      never choose any guards past it. This way we don't expand our
+      guard list unless we need to. [Bugfix in 0.1.2.x]
 
+
 Changes in version 0.2.0.2-alpha - 2007-06-02
   o Major bugfixes on 0.2.0.1-alpha:
     - Fix an assertion failure related to servers without extra-info digests.

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2007-07-02 22:07:53 UTC (rev 10729)
+++ tor/trunk/src/or/circuitbuild.c	2007-07-02 22:15:26 UTC (rev 10730)
@@ -2418,6 +2418,13 @@
       r = entry_is_live(entry, need_uptime, need_capacity, 0);
       if (r && !smartlist_isin(exit_family, r)) {
         smartlist_add(live_entry_guards, r);
+        if (!entry->made_contact) {
+          /* Always start with the first not-yet-contacted entry
+           * guard. Otherwise we might add several new ones, pick
+           * the second new one, and now we've expanded our entry
+           * guard list without needing to. */
+          goto choose_and_finish;
+        }
         if (smartlist_len(live_entry_guards) >= options->NumEntryGuards)
           break; /* we have enough */
       }
@@ -2451,6 +2458,7 @@
     /* live_entry_guards may be empty below. Oh well, we tried. */
   }
 
+ choose_and_finish:
   r = smartlist_choose(live_entry_guards);
   smartlist_free(live_entry_guards);
   smartlist_free(exit_family);



More information about the tor-commits mailing list