[or-cvs] r17637: {tor} Backport r17091: when we have no pending streams, choose exi (in tor/branches/tor-0_2_0-patches: . doc src/or)

nickm at seul.org nickm at seul.org
Wed Dec 17 13:14:40 UTC 2008


Author: nickm
Date: 2008-12-17 08:14:40 -0500 (Wed, 17 Dec 2008)
New Revision: 17637

Modified:
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/doc/TODO.020
   tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c
Log:
Backport r17091: when we have no pending streams, choose exits with choose_good_exit_server_general rather than with circuit_get_unhandled_ports().

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-12-17 12:51:36 UTC (rev 17636)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-12-17 13:14:40 UTC (rev 17637)
@@ -31,6 +31,9 @@
       until one succeeds.  Fixes bug 691.
     - Use 64 bits instead of 32 bits for connection identifiers used with
       the controller protocol, to greatly reduce risk of identifier reuse.
+    - When we're choosing an exit node for a circuit, and we have no pending
+      streams, choose a good general exit rather than one that supports "all
+      the pending streams".  Bugfix on 0.1.1.x. (Fix by rovv.)
 
   o Minor features:
     - Report the case where all signatures in a detached set are rejected

Modified: tor/branches/tor-0_2_0-patches/doc/TODO.020
===================================================================
--- tor/branches/tor-0_2_0-patches/doc/TODO.020	2008-12-17 12:51:36 UTC (rev 17636)
+++ tor/branches/tor-0_2_0-patches/doc/TODO.020	2008-12-17 13:14:40 UTC (rev 17637)
@@ -12,8 +12,10 @@
             approach). (Also maybe r16674)
     [Partially backported.  Instead of the basic name checking, I backported
      r17171 instead, to be even more resistant to poisoning.]
-  - r17091: distinguish "no routers support pending circuits" from
-            "no circuits are pending." See also r17181 and r17184.
+  o r17091: distinguish "no routers support pending circuits" from
+            "no circuits are pending."
+    - See also r17181...
+    - ... and r17184.
   - r17137: send END cell in response to connect to nonexistent hidserv port.
   - r17138: reject *:* servers should never do DNS lookups.
   - r17139: Fix another case of overriding .exit choices.

Modified: tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c	2008-12-17 12:51:36 UTC (rev 17636)
+++ tor/branches/tor-0_2_0-patches/src/or/circuitbuild.c	2008-12-17 13:14:40 UTC (rev 17637)
@@ -1255,6 +1255,11 @@
 //               router->nickname, i);
       }
     }); /* End looping over connections. */
+    if (n_pending_connections > 0 && n_supported[i] == 0) {
+      /* Leave best_support at -1 if that's where it is, so we can
+       * distinguish it later. */
+      continue;
+    }
     if (n_supported[i] > best_support) {
       /* If this router is better than previous ones, remember its index
        * and goodness, and start counting how many routers are this good. */



More information about the tor-commits mailing list