[tor-commits] [tor/master] Replace several C identifiers.

nickm at torproject.org nickm at torproject.org
Tue Jun 9 19:45:23 UTC 2020


commit 05c56ae455de1f8e1dc9816ab9dcd7f0cdc2c994
Author: teor <teor at riseup.net>
Date:   Thu May 7 20:07:13 2020 +1000

    Replace several C identifiers.
    
    This is an automated commit, generated by this command:
    
    ./scripts/maint/rename_c_identifier.py \
            router_skip_orport_reachability_check router_should_skip_orport_reachability_check \
            router_skip_dirport_reachability_check router_should_skip_dirport_reachability_check \
            router_connect_assume_or_reachable client_or_conn_should_skip_reachable_address_check \
            router_connect_assume_dir_reachable client_dir_conn_should_skip_reachable_address_check
    
    It was generated with --no-verify, so it probably breaks some commit hooks.
    The commiter should be sure to fix them up in a subsequent commit.
---
 src/core/or/circuitbuild.c            |  2 +-
 src/core/or/circuituse.c              |  4 ++--
 src/feature/control/control_getinfo.c |  8 ++++----
 src/feature/nodelist/node_select.c    |  8 ++++----
 src/feature/nodelist/routerlist.c     |  6 +++---
 src/feature/nodelist/routerlist.h     |  4 ++--
 src/feature/relay/relay_periodic.c    |  4 ++--
 src/feature/relay/router.c            |  4 ++--
 src/feature/relay/selftest.c          | 14 +++++++-------
 src/feature/relay/selftest.h          |  8 ++++----
 src/feature/stats/predict_ports.c     |  4 ++--
 11 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c
index c4d544a64..8d5988b63 100644
--- a/src/core/or/circuitbuild.c
+++ b/src/core/or/circuitbuild.c
@@ -1051,7 +1051,7 @@ circuit_build_no_more_hops(origin_circuit_t *circ)
     control_event_client_status(LOG_NOTICE, "CIRCUIT_ESTABLISHED");
     clear_broken_connection_map(1);
     if (server_mode(options) &&
-        !router_skip_orport_reachability_check(options)) {
+        !router_should_skip_orport_reachability_check(options)) {
       inform_testing_reachability();
       router_do_reachability_checks(1, 1);
     }
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index 51e328133..3ab527f42 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -1641,7 +1641,7 @@ static void
 circuit_testing_opened(origin_circuit_t *circ)
 {
   if (have_performed_bandwidth_test ||
-      !router_skip_orport_reachability_check(get_options())) {
+      !router_should_skip_orport_reachability_check(get_options())) {
     /* either we've already done everything we want with testing circuits,
      * or this testing circuit became open due to a fluke, e.g. we picked
      * a last hop where we already had the connection open due to an
@@ -1659,7 +1659,7 @@ static void
 circuit_testing_failed(origin_circuit_t *circ, int at_last_hop)
 {
   const or_options_t *options = get_options();
-  if (server_mode(options) && router_skip_orport_reachability_check(options))
+  if (server_mode(options) && router_should_skip_orport_reachability_check(options))
     return;
 
   log_info(LD_GENERAL,
diff --git a/src/feature/control/control_getinfo.c b/src/feature/control/control_getinfo.c
index d80d5a73f..52cf54b1c 100644
--- a/src/feature/control/control_getinfo.c
+++ b/src/feature/control/control_getinfo.c
@@ -1276,15 +1276,15 @@ getinfo_helper_events(control_connection_t *control_conn,
       *answer = tor_strdup(directories_have_accepted_server_descriptor()
                            ? "1" : "0");
     } else if (!strcmp(question, "status/reachability-succeeded/or")) {
-      *answer = tor_strdup(router_skip_orport_reachability_check(options) ?
+      *answer = tor_strdup(router_should_skip_orport_reachability_check(options) ?
                             "1" : "0");
     } else if (!strcmp(question, "status/reachability-succeeded/dir")) {
-      *answer = tor_strdup(router_skip_dirport_reachability_check(options) ?
+      *answer = tor_strdup(router_should_skip_dirport_reachability_check(options) ?
                             "1" : "0");
     } else if (!strcmp(question, "status/reachability-succeeded")) {
       tor_asprintf(answer, "OR=%d DIR=%d",
-                   router_skip_orport_reachability_check(options) ? 1 : 0,
-                   router_skip_dirport_reachability_check(options) ? 1 : 0);
+                   router_should_skip_orport_reachability_check(options) ? 1 : 0,
+                   router_should_skip_dirport_reachability_check(options) ? 1 : 0);
     } else if (!strcmp(question, "status/bootstrap-phase")) {
       *answer = control_event_boot_last_msg();
     } else if (!strcmpstart(question, "status/version/")) {
diff --git a/src/feature/nodelist/node_select.c b/src/feature/nodelist/node_select.c
index da10856f5..d2118c524 100644
--- a/src/feature/nodelist/node_select.c
+++ b/src/feature/nodelist/node_select.c
@@ -321,9 +321,9 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
   overloaded_direct = smartlist_new();
   overloaded_tunnel = smartlist_new();
 
-  const int skip_or_fw = router_connect_assume_or_reachable(options,
+  const int skip_or_fw = client_or_conn_should_skip_reachable_address_check(options,
                                                             try_ip_pref);
-  const int skip_dir_fw = router_connect_assume_dir_reachable(options,
+  const int skip_dir_fw = client_dir_conn_should_skip_reachable_address_check(options,
                                                               try_ip_pref);
   const int must_have_or = dirclient_must_use_begindir(options);
 
@@ -1122,9 +1122,9 @@ router_pick_trusteddirserver_impl(const smartlist_t *sourcelist,
   overloaded_direct = smartlist_new();
   overloaded_tunnel = smartlist_new();
 
-  const int skip_or_fw = router_connect_assume_or_reachable(options,
+  const int skip_or_fw = client_or_conn_should_skip_reachable_address_check(options,
                                                             try_ip_pref);
-  const int skip_dir_fw = router_connect_assume_dir_reachable(options,
+  const int skip_dir_fw = client_dir_conn_should_skip_reachable_address_check(options,
                                                               try_ip_pref);
   const int must_have_or = dirclient_must_use_begindir(options);
 
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c
index df94e1dce..0e8fff7c3 100644
--- a/src/feature/nodelist/routerlist.c
+++ b/src/feature/nodelist/routerlist.c
@@ -476,7 +476,7 @@ router_reload_router_list(void)
  * Finally, return true if ReachableAddresses is set.
  */
 int
-router_connect_assume_or_reachable(const or_options_t *options,
+client_or_conn_should_skip_reachable_address_check(const or_options_t *options,
                                    int try_ip_pref)
 {
   /* Servers always have and prefer IPv4.
@@ -491,7 +491,7 @@ router_connect_assume_or_reachable(const or_options_t *options,
  * This function is obsolete, because clients only use ORPorts.
  */
 int
-router_connect_assume_dir_reachable(const or_options_t *options,
+client_dir_conn_should_skip_reachable_address_check(const or_options_t *options,
                                     int try_ip_pref)
 {
   /* Servers always have and prefer IPv4.
@@ -518,7 +518,7 @@ router_add_running_nodes_to_smartlist(smartlist_t *sl, int need_uptime,
                                       int need_desc, int pref_addr,
                                       int direct_conn)
 {
-  const int check_reach = !router_connect_assume_or_reachable(get_options(),
+  const int check_reach = !client_or_conn_should_skip_reachable_address_check(get_options(),
                                                        pref_addr);
   /* XXXX MOVE */
   SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), const node_t *, node) {
diff --git a/src/feature/nodelist/routerlist.h b/src/feature/nodelist/routerlist.h
index 78d8bfc64..55eec6c3f 100644
--- a/src/feature/nodelist/routerlist.h
+++ b/src/feature/nodelist/routerlist.h
@@ -50,9 +50,9 @@ typedef enum was_router_added_t {
 
 int router_reload_router_list(void);
 
-int router_connect_assume_or_reachable(const or_options_t *options,
+int client_or_conn_should_skip_reachable_address_check(const or_options_t *options,
                                        int try_ip_pref);
-int router_connect_assume_dir_reachable(const or_options_t *options,
+int client_dir_conn_should_skip_reachable_address_check(const or_options_t *options,
                                         int try_ip_pref);
 void router_reset_status_download_failures(void);
 int routers_have_same_or_addrs(const routerinfo_t *r1, const routerinfo_t *r2);
diff --git a/src/feature/relay/relay_periodic.c b/src/feature/relay/relay_periodic.c
index c8b6a7d80..2b6be1ce1 100644
--- a/src/feature/relay/relay_periodic.c
+++ b/src/feature/relay/relay_periodic.c
@@ -201,7 +201,7 @@ reachability_warnings_callback(time_t now, const or_options_t *options)
       have_completed_a_circuit()) {
     /* every 20 minutes, check and complain if necessary */
     const routerinfo_t *me = router_get_my_routerinfo();
-    if (me && !router_skip_orport_reachability_check(options)) {
+    if (me && !router_should_skip_orport_reachability_check(options)) {
       char *address = tor_dup_ip(me->addr);
       log_warn(LD_CONFIG,"Your server (%s:%d) has not managed to confirm that "
                "its ORPort is reachable. Relays do not publish descriptors "
@@ -214,7 +214,7 @@ reachability_warnings_callback(time_t now, const or_options_t *options)
       tor_free(address);
     }
 
-    if (me && !router_skip_dirport_reachability_check(options)) {
+    if (me && !router_should_skip_dirport_reachability_check(options)) {
       char *address = tor_dup_ip(me->addr);
       log_warn(LD_CONFIG,
                "Your server (%s:%d) has not managed to confirm that its "
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index ebe656590..1a35e27e1 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -1361,14 +1361,14 @@ decide_if_publishable_server(void)
     return 1;
   if (!router_get_advertised_or_port(options))
     return 0;
-  if (!router_skip_orport_reachability_check(options))
+  if (!router_should_skip_orport_reachability_check(options))
     return 0;
   if (router_have_consensus_path() == CONSENSUS_PATH_INTERNAL) {
     /* All set: there are no exits in the consensus (maybe this is a tiny
      * test network), so we can't check our DirPort reachability. */
     return 1;
   } else {
-    return router_skip_dirport_reachability_check(options);
+    return router_should_skip_dirport_reachability_check(options);
   }
 }
 
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index 4a8ecdd94..a498e3dff 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -77,7 +77,7 @@ router_reachability_checks_disabled(const or_options_t *options)
  *   - the network is disabled.
  */
 int
-router_skip_orport_reachability_check(const or_options_t *options)
+router_should_skip_orport_reachability_check(const or_options_t *options)
 {
   int reach_checks_disabled = router_reachability_checks_disabled(options);
   return reach_checks_disabled ||
@@ -94,7 +94,7 @@ router_skip_orport_reachability_check(const or_options_t *options)
  *   - the network is disabled.
  */
 int
-router_skip_dirport_reachability_check(const or_options_t *options)
+router_should_skip_dirport_reachability_check(const or_options_t *options)
 {
   int reach_checks_disabled = router_reachability_checks_disabled(options) ||
                               !options->DirPort_set;
@@ -154,7 +154,7 @@ extend_info_from_router(const routerinfo_t *r, int family)
 
   /* Relays always assume that the first hop is reachable. They ignore
    * ReachableAddresses. */
-  tor_assert_nonfatal(router_connect_assume_or_reachable(get_options(), 0));
+  tor_assert_nonfatal(client_or_conn_should_skip_reachable_address_check(get_options(), 0));
 
   const ed25519_public_key_t *ed_id_key;
   if (r->cache_info.signing_key_cert)
@@ -251,7 +251,7 @@ router_do_reachability_checks(int test_or, int test_dir)
 {
   const routerinfo_t *me = router_get_my_routerinfo();
   const or_options_t *options = get_options();
-  int orport_reachable = router_skip_orport_reachability_check(options);
+  int orport_reachable = router_should_skip_orport_reachability_check(options);
 
   if (router_should_check_reachability(test_or, test_dir)) {
     if (test_or && (!orport_reachable || !circuit_enough_testing_circs())) {
@@ -260,7 +260,7 @@ router_do_reachability_checks(int test_or, int test_dir)
       router_do_orport_reachability_checks(me, AF_INET6, orport_reachable);
     }
 
-    if (test_dir && !router_skip_dirport_reachability_check(options)) {
+    if (test_dir && !router_should_skip_dirport_reachability_check(options)) {
       router_do_dirport_reachability_checks(me);
     }
   }
@@ -319,7 +319,7 @@ router_orport_found_reachable(void)
     log_notice(LD_OR,"Self-testing indicates your ORPort is reachable from "
                "the outside. Excellent.%s",
                options->PublishServerDescriptor_ != NO_DIRINFO
-               && router_skip_dirport_reachability_check(options) ?
+               && router_should_skip_dirport_reachability_check(options) ?
                  " Publishing server descriptor." : "");
     can_reach_or_port = 1;
     mark_my_descriptor_dirty("ORPort found reachable");
@@ -347,7 +347,7 @@ router_dirport_found_reachable(void)
     log_notice(LD_DIRSERV,"Self-testing indicates your DirPort is reachable "
                "from the outside. Excellent.%s",
                options->PublishServerDescriptor_ != NO_DIRINFO
-               && router_skip_orport_reachability_check(options) ?
+               && router_should_skip_orport_reachability_check(options) ?
                " Publishing server descriptor." : "");
     can_reach_dir_port = 1;
     if (router_should_advertise_dirport(options, me->dir_port)) {
diff --git a/src/feature/relay/selftest.h b/src/feature/relay/selftest.h
index ce30d92a2..f2350cf8f 100644
--- a/src/feature/relay/selftest.h
+++ b/src/feature/relay/selftest.h
@@ -15,8 +15,8 @@
 #ifdef HAVE_MODULE_RELAY
 
 struct or_options_t;
-int router_skip_orport_reachability_check(const struct or_options_t *options);
-int router_skip_dirport_reachability_check(const struct or_options_t *options);
+int router_should_skip_orport_reachability_check(const struct or_options_t *options);
+int router_should_skip_dirport_reachability_check(const struct or_options_t *options);
 
 void router_do_reachability_checks(int test_or, int test_dir);
 void router_perform_bandwidth_test(int num_circs, time_t now);
@@ -29,9 +29,9 @@ void router_reset_reachability(void);
 
 #else /* !defined(HAVE_MODULE_RELAY) */
 
-#define router_skip_orport_reachability_check(opts) \
+#define router_should_skip_orport_reachability_check(opts) \
   ((void)(opts), 0)
-#define router_skip_dirport_reachability_check(opts) \
+#define router_should_skip_dirport_reachability_check(opts) \
   ((void)(opts), 0)
 
 static inline void
diff --git a/src/feature/stats/predict_ports.c b/src/feature/stats/predict_ports.c
index 4cb576c7c..440cea672 100644
--- a/src/feature/stats/predict_ports.c
+++ b/src/feature/stats/predict_ports.c
@@ -270,10 +270,10 @@ rep_hist_circbuilding_dormant(time_t now)
 
   /* see if we'll still need to build testing circuits */
   if (server_mode(options) &&
-      (!router_skip_orport_reachability_check(options) ||
+      (!router_should_skip_orport_reachability_check(options) ||
        !circuit_enough_testing_circs()))
     return 0;
-  if (!router_skip_dirport_reachability_check(options))
+  if (!router_should_skip_dirport_reachability_check(options))
     return 0;
 
   return 1;





More information about the tor-commits mailing list