From: Nick Mathewson Date: Wed, 19 Oct 2016 21:11:47 +0000 (-0400) Subject: Merge remote-tracking branch 'andrea/ticket19858_v2' X-Git-Tag: tor-0.3.0.1-alpha~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12cf73c4516132a85f76d1c6e60c9492e8751987;p=thirdparty%2Ftor.git Merge remote-tracking branch 'andrea/ticket19858_v2' Conflict in entrynodes.c: any_bridge_supports_microdescriptors was removed in master, and modified in 19858_v2 --- 12cf73c4516132a85f76d1c6e60c9492e8751987 diff --cc src/or/entrynodes.c index ff02fedbd4,5cd2b72824..b3fa31df7b --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@@ -2521,6 -2777,45 +2777,22 @@@ entries_retry_all(const or_options_t *o entries_retry_helper(options, 1); } -/** Return true if at least one of our bridges runs a Tor version that can - * provide microdescriptors to us. If not, we'll fall back to asking for - * full descriptors. */ -int -any_bridge_supports_microdescriptors(void) -{ - const node_t *node; - guard_selection_t *gs = get_guard_selection_info(); - - if (!get_options()->UseBridges || !(gs->chosen_entry_guards)) - return 0; - SMARTLIST_FOREACH_BEGIN(gs->chosen_entry_guards, entry_guard_t *, e) { - node = node_get_by_id(e->identity); - if (node && node->is_running && - node_is_bridge(node) && node_is_a_configured_bridge(node)) { - /* This is one of our current bridges, and we know enough about - * it to know that it will be able to answer our questions. */ - return 1; - } - } SMARTLIST_FOREACH_END(e); - return 0; -} - + /** Free one guard selection context */ + static void + guard_selection_free(guard_selection_t *gs) + { + if (!gs) return; + + if (gs->chosen_entry_guards) { + SMARTLIST_FOREACH(gs->chosen_entry_guards, entry_guard_t *, e, + entry_guard_free(e)); + smartlist_free(gs->chosen_entry_guards); + gs->chosen_entry_guards = NULL; + } + + tor_free(gs); + } + /** Release all storage held by the list of entry guards and related * memory structs. */ void