[or-cvs] r18451: {tor} Retry circuits if the exit node is optional and nonexistant. (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Mon Feb 9 16:55:48 UTC 2009


Author: nickm
Date: 2009-02-09 11:55:48 -0500 (Mon, 09 Feb 2009)
New Revision: 18451

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuituse.c
Log:
Retry circuits if the exit node is optional and nonexistant.

Previously, when we had the chosen_exit set but marked optional, and
we failed because we couldn't find an onion key for it, we'd just give
up on the circuit.  But what we really want to do is try again, without
the forced exit node.

Spotted by rovv.  Another case of bug 752.  I think this might be
unreachable in our current code, but proposal 158 could change that.

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2009-02-09 16:07:02 UTC (rev 18450)
+++ tor/trunk/ChangeLog	2009-02-09 16:55:48 UTC (rev 18451)
@@ -5,6 +5,11 @@
       We previously did this from the startup script, but that was no
       help to people who didn't use the startup script.  Resolves
       bug 863.
+    - When we had picked an exit node for a connection, but marked it as
+      "optional", and it turned out we had no onion key for the exit,
+      stop preferring the exit and try again.  This situation may not be
+      possible now, but will probably become feasible with proposal 158.
+      Spotted by rovv.  Fixes another case of bug 752.
 
   o Minor features:
     - On Linux, use the prctl call to re-enable core dumps when the user

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2009-02-09 16:07:02 UTC (rev 18450)
+++ tor/trunk/src/or/circuituse.c	2009-02-09 16:55:48 UTC (rev 18451)
@@ -1165,7 +1165,10 @@
             if (opt) {
               conn->chosen_exit_optional = 0;
               tor_free(conn->chosen_exit_name);
-              return 0;
+              /* Try again with no requested exit */
+              return circuit_get_open_circ_or_launch(conn,
+                                                     desired_circuit_purpose,
+                                                     circp);
             }
             return -1;
           }



More information about the tor-commits mailing list