diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-05-31 01:02:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-05-31 01:02:27 -0400 |
commit | 32d6acade8488e8f3b1a85585d5136bf9a8ca76f (patch) | |
tree | 4222a5d40607c06f1a40aa88ce55aab7c2436414 /src | |
parent | ffc21b653f08e3826867c14d44d6543d262bb417 (diff) | |
parent | 6757261e8f8b8b2f79a07122a2324654d5fbb1b9 (diff) | |
download | tor-32d6acade8488e8f3b1a85585d5136bf9a8ca76f.tar tor-32d6acade8488e8f3b1a85585d5136bf9a8ca76f.tar.gz |
Merge remote-tracking branch 'public/bug3196'
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerlist.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 0abc2e9bc..36a282a30 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -5004,7 +5004,14 @@ update_router_have_minimum_dir_info(void) count_usable_descriptors(&num_exit_present, &num_exit_usable, consensus, options, now, options->ExitNodes, 1); - if (num_present < num_usable/4) { +/* What fraction of desired server descriptors do we need before we will + * build circuits? */ +#define FRACTION_USABLE_NEEDED .75 +/* What fraction of desired _exit_ server descriptors do we need before we + * will build circuits? */ +#define FRACTION_EXIT_USABLE_NEEDED .5 + + if (num_present < num_usable * FRACTION_USABLE_NEEDED) { tor_snprintf(dir_info_status, sizeof(dir_info_status), "We have only %d/%d usable %sdescriptors.", num_present, num_usable, using_md ? "micro" : ""); @@ -5017,7 +5024,7 @@ update_router_have_minimum_dir_info(void) num_present, using_md ? "micro" : "", num_present ? "" : "s"); res = 0; goto done; - } else if (num_exit_present < num_exit_usable / 3) { + } else if (num_exit_present < num_exit_usable * FRACTION_EXIT_USABLE_NEEDED) { tor_snprintf(dir_info_status, sizeof(dir_info_status), "We have only %d/%d usable exit node descriptors.", num_exit_present, num_exit_usable); |