[tor-commits] [tor/master] Merge remote-tracking branch 'andrea/ticket19858_v2'

nickm at torproject.org nickm at torproject.org
Wed Oct 19 21:16:05 UTC 2016


commit 12cf73c4516132a85f76d1c6e60c9492e8751987
Merge: ec4142a 1c6f884
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Oct 19 17:11:47 2016 -0400

    Merge remote-tracking branch 'andrea/ticket19858_v2'
    
    Conflict in entrynodes.c: any_bridge_supports_microdescriptors was
    removed in master, and modified in 19858_v2

 changes/ticket19858        |   4 +
 src/or/circuitbuild.c      |   1 -
 src/or/entrynodes.c        | 610 ++++++++++++++++++++++++++++++++-------------
 src/or/entrynodes.h        |  31 ++-
 src/or/or.h                |   3 -
 src/or/routerlist.c        |   6 +-
 src/test/test_entrynodes.c |  18 +-
 src/test/test_routerlist.c |  68 ++++-
 8 files changed, 550 insertions(+), 191 deletions(-)

diff --cc src/or/entrynodes.c
index ff02fed,5cd2b72..b3fa31d
--- 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





More information about the tor-commits mailing list