commit 7b4b137dc9b97c74b55a5835926513d7333fff67 Merge: 0cca8dc 6ab10a5 Author: Nick Mathewson nickm@torproject.org Date: Wed Apr 23 10:57:46 2014 -0400
Merge remote-tracking branch 'public/bug9229_025'
Conflicts: src/or/entrynodes.c
changes/bug9229_025 | 5 +++++ src/or/entrynodes.c | 36 ++++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-)
diff --cc src/or/entrynodes.c index b374ac7,da3521e..70587bd --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@@ -2207,6 -2215,39 +2215,18 @@@ any_bridge_descriptors_known(void return choose_random_entry(NULL) != NULL; }
+ /** Return the number of bridges that have descriptors that are marked with + * purpose 'bridge' and are running. + */ + static int + num_bridges_usable(void) + { + int n_options = 0; + tor_assert(get_options()->UseBridges); + (void) choose_random_entry_impl(NULL, 0, 0, &n_options); + return n_options; + } + -/** Return 1 if there are any directory conns fetching bridge descriptors - * that aren't marked for close. We use this to guess if we should tell - * the controller that we have a problem. */ -int -any_pending_bridge_descriptor_fetches(void) -{ - smartlist_t *conns = get_connection_array(); - SMARTLIST_FOREACH_BEGIN(conns, connection_t *, conn) { - if (conn->type == CONN_TYPE_DIR && - conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC && - TO_DIR_CONN(conn)->router_purpose == ROUTER_PURPOSE_BRIDGE && - !conn->marked_for_close && - conn->linked && - conn->linked_conn && !conn->linked_conn->marked_for_close) { - log_debug(LD_DIR, "found one: %s", conn->address); - return 1; - } - } SMARTLIST_FOREACH_END(conn); - return 0; -} - /** Return 1 if we have at least one descriptor for an entry guard * (bridge or member of EntryNodes) and all descriptors we know are * down. Else return 0. If <b>act</b> is 1, then mark the down guards