summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-10 17:16:41 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-10 17:16:41 +0000
commit52363d23d76c2ba5139a4985302b31fe1ff58cf2 (patch)
tree97dd145586d01b0ac2f2e3089e8d36f3427471e4 /src/or/circuitbuild.c
parentee6ae92670b587baa45c5088f52278db4bef0205 (diff)
downloadtor-52363d23d76c2ba5139a4985302b31fe1ff58cf2.tar.gz
tor-52363d23d76c2ba5139a4985302b31fe1ff58cf2.zip
If we can't expand our list of entry guards (e.g. because we're
using bridges or we have StrictEntryNodes set), don't mark relays down when they fail a directory request. Otherwise we're too quick to mark all our entry points down. svn:r12755
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 1f1018a51a..22d9c912dc 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2430,8 +2430,8 @@ entry_guards_prepend_from_config(void)
/** Return 1 if we're fine adding arbitrary routers out of the
* directory to our entry guard list. Else return 0. */
-static int
-can_grow_entry_list(or_options_t *options)
+int
+entry_list_can_grow(or_options_t *options)
{
if (options->StrictEntryNodes)
return 0;
@@ -2469,7 +2469,7 @@ choose_random_entry(cpath_build_state_t *state)
if (should_add_entry_nodes)
entry_guards_prepend_from_config();
- if (can_grow_entry_list(options) &&
+ if (entry_list_can_grow(options) &&
(! entry_guards ||
smartlist_len(entry_guards) < options->NumEntryGuards))
pick_entry_guards();
@@ -2498,7 +2498,7 @@ 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 (can_grow_entry_list(options)) {
+ if (entry_list_can_grow(options)) {
/* still no? try adding a new entry then */
/* XXX if guard doesn't imply fast and stable, then we need
* to tell add_an_entry_guard below what we want, or it might
@@ -2518,7 +2518,7 @@ choose_random_entry(cpath_build_state_t *state)
need_capacity = 0;
goto retry;
}
- if (!r && !can_grow_entry_list(options) && consider_exit_family) {
+ if (!r && !entry_list_can_grow(options) && consider_exit_family) {
/* still no? if we're using bridges or have strictentrynodes
* set, and our chosen exit is in the same family as all our
* bridges/entry guards, then be flexible about families. */