]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'public/bug9229_025'
authorNick Mathewson <nickm@torproject.org>
Wed, 23 Apr 2014 14:57:46 +0000 (10:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 23 Apr 2014 15:00:49 +0000 (11:00 -0400)
Conflicts:
src/or/entrynodes.c

1  2 
src/or/entrynodes.c

index b374ac7a34335699e867d154aee661ff83b737ae,da3521ecd385ea4efaff6b998e7449d089f2c2af..70587bd75808922ba2f471cca0d874c4f4efbda4
@@@ -2207,6 -2215,39 +2215,18 @@@ any_bridge_descriptors_known(void
    return choose_random_entry(NULL) != NULL;
  }
  
 -/** 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 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 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