diff options
author | Roger Dingledine <arma@torproject.org> | 2006-10-07 02:57:19 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-10-07 02:57:19 +0000 |
commit | 8fe86704d5550a70730a754eb58f22bd994ae701 (patch) | |
tree | 2c3eef53da42628e7f5b27f2e9111e5e651d0c05 | |
parent | 303f5495b95f8dc16fe85977f207202d33b8d81a (diff) | |
download | tor-8fe86704d5550a70730a754eb58f22bd994ae701.tar.gz tor-8fe86704d5550a70730a754eb58f22bd994ae701.zip |
backport: If none of our live entry guards have a high uptime, but we
require a guard with a high uptime, try adding a new guard before
we give up on the requirement. This patch should make long-lived
connections more stable on average.
svn:r8629
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | src/or/circuitbuild.c | 8 |
2 files changed, 14 insertions, 10 deletions
@@ -3,16 +3,20 @@ Changes in version 0.1.1.25 - 2006-10-?? [ongoing] - When a client asks us to resolve (not connect to) an address, and we have a cached answer, give them the cached answer. Previously, we would give them no answer at all. + - We were building exactly the wrong circuits when we predict + hidden service requirements, meaning Tor would have to build all + its circuits on demand. + - If none of our live entry guards have a high uptime, but we + require a guard with a high uptime, try adding a new guard before + we give up on our requirement. This patch should make long-lived + connections more stable on average. o Minor bugfixes: - Avoid a memory corruption bug when creating a hash table for the first time. - - We were building exactly the wrong circuits when we anticipated - hidden service requirements, meaning Tor would have to build all - its circuits on demand. - - Avoid possibility of controller-triggered crash when misusing certain - commands from a v0 controller on platforms that do not handle - printf("%s",NULL) gracefully. + - Avoid possibility of controller-triggered crash when misusing + certain commands from a v0 controller on platforms that do not + handle printf("%s",NULL) gracefully. Changes in version 0.1.1.24 - 2006-09-29 diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 6a9ed3b16b..ff3898ead2 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2228,10 +2228,6 @@ choose_random_entry(cpath_build_state_t *state) * using him. * (We might get 2 live-but-crummy entry guards, but so be it.) */ if (smartlist_len(live_entry_guards) < 2) { - if (need_uptime) { - need_uptime = 0; /* try without that requirement */ - goto retry; - } if (!options->StrictEntryNodes) { /* still no? try adding a new entry then */ r = add_an_entry_guard(NULL); @@ -2240,6 +2236,10 @@ choose_random_entry(cpath_build_state_t *state) entry_guards_changed(); } } + if (!r && need_uptime) { + need_uptime = 0; /* try without that requirement */ + goto retry; + } if (!r && need_capacity) { /* still no? last attempt, try without requiring capacity */ need_capacity = 0; |