Browse Source

Remove argument from guards_choose_dirguard

Nick Mathewson 7 years ago
parent
commit
d5d7c3e638
3 changed files with 5 additions and 17 deletions
  1. 2 3
      src/or/directory.c
  2. 2 12
      src/or/entrynodes.c
  3. 1 2
      src/or/entrynodes.h

+ 2 - 3
src/or/directory.c

@@ -469,7 +469,7 @@ directory_pick_generic_dirserver(dirinfo_type_t type, int pds_flags,
     log_warn(LD_BUG, "Called when we have UseBridges set.");
     log_warn(LD_BUG, "Called when we have UseBridges set.");
 
 
   if (should_use_directory_guards(options)) {
   if (should_use_directory_guards(options)) {
-    const node_t *node = guards_choose_dirguard(type, guard_state_out);
+    const node_t *node = guards_choose_dirguard(guard_state_out);
     if (node)
     if (node)
       rs = node->rs;
       rs = node->rs;
   } else {
   } else {
@@ -559,8 +559,7 @@ MOCK_IMPL(void, directory_get_from_dirserver, (
        * sort of dir fetch we'll be doing, so it won't return a bridge
        * sort of dir fetch we'll be doing, so it won't return a bridge
        * that can't answer our question.
        * that can't answer our question.
        */
        */
-      const node_t *node = guards_choose_dirguard(type,
-                                                  &guard_state);
+      const node_t *node = guards_choose_dirguard(&guard_state);
       if (node && node->ri) {
       if (node && node->ri) {
         /* every bridge has a routerinfo. */
         /* every bridge has a routerinfo. */
         routerinfo_t *ri = node->ri;
         routerinfo_t *ri = node->ri;

+ 2 - 12
src/or/entrynodes.c

@@ -3123,7 +3123,6 @@ getinfo_helper_format_single_entry_guard(const entry_guard_t *e)
     status = "up";
     status = "up";
   }
   }
 
 
-
   node = entry_guard_find_node(e);
   node = entry_guard_find_node(e);
   if (node) {
   if (node) {
     node_get_verbose_nickname(node, nbuf);
     node_get_verbose_nickname(node, nbuf);
@@ -3266,17 +3265,8 @@ guards_choose_guard(cpath_build_state_t *state,
 
 
 /** Helper: pick a directory guard, with whatever algorithm is used. */
 /** Helper: pick a directory guard, with whatever algorithm is used. */
 const node_t *
 const node_t *
-guards_choose_dirguard(dirinfo_type_t info,
-                      circuit_guard_state_t **guard_state_out)
-{
-  /* XXXX prop271 We don't need to look at the dirinfo_type_t here,
-   * apparently. If you look at the old implementation, and you follow info
-   * downwards through choose_random_dirguard(), into
-   * choose_random_entry_impl(), into populate_live_entry_guards()... you
-   * find out that it isn't even used, and hasn't been since 0.2.7.1-alpha,
-   * when we realized that every Tor on the network would support
-   * microdescriptors. -NM */
-  (void) info;
+guards_choose_dirguard(circuit_guard_state_t **guard_state_out)
+{
   const node_t *r = NULL;
   const node_t *r = NULL;
   if (entry_guard_pick_for_circuit(get_guard_selection_info(),
   if (entry_guard_pick_for_circuit(get_guard_selection_info(),
                                    GUARD_USAGE_DIRGUARD,
                                    GUARD_USAGE_DIRGUARD,

+ 1 - 2
src/or/entrynodes.h

@@ -314,8 +314,7 @@ struct circuit_guard_state_t {
 int guards_update_all(void);
 int guards_update_all(void);
 const node_t *guards_choose_guard(cpath_build_state_t *state,
 const node_t *guards_choose_guard(cpath_build_state_t *state,
                                   circuit_guard_state_t **guard_state_out);
                                   circuit_guard_state_t **guard_state_out);
-const node_t *guards_choose_dirguard(dirinfo_type_t info,
-                                     circuit_guard_state_t **guard_state_out);
+const node_t *guards_choose_dirguard(circuit_guard_state_t **guard_state_out);
 
 
 #if 1
 #if 1
 /* XXXX NM I would prefer that all of this stuff be private to
 /* XXXX NM I would prefer that all of this stuff be private to