[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] hs: Rename num_rend_services()



commit 4a8cf17897ca23f8352a27c1bffb6ebfd68a1e0e
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Mon Jul 10 11:31:51 2017 -0400

    hs: Rename num_rend_services()
    
    Renamed to rend_num_services() so it is consistent with the legacy naming.
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 src/or/circuituse.c        | 2 +-
 src/or/hs_service.c        | 6 +++---
 src/or/rendservice.c       | 2 +-
 src/or/rendservice.h       | 2 +-
 src/test/test_hs_config.c  | 2 +-
 src/test/test_hs_service.c | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 4d450f114..247c5bbbb 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1115,7 +1115,7 @@ needs_exit_circuits(time_t now, int *needs_uptime, int *needs_capacity)
 STATIC int
 needs_hs_server_circuits(int num_uptime_internal)
 {
-  return (num_rend_services() &&
+  return (rend_num_services() &&
           num_uptime_internal < SUFFICIENT_UPTIME_INTERNAL_HS_SERVERS &&
           router_have_consensus_path() != CONSENSUS_PATH_UNKNOWN);
 }
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index 2a3537966..9f496b615 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -1864,7 +1864,7 @@ run_build_circuit_event(time_t now)
   }
 
   /* Run v2 check. */
-  if (num_rend_services() > 0) {
+  if (rend_num_services() > 0) {
     rend_consider_services_intro_points(now);
   }
 
@@ -2074,7 +2074,7 @@ run_upload_descriptor_event(time_t now)
 {
   /* v2 services use the same function for descriptor creation and upload so
    * we do everything here because the intro circuits were checked before. */
-  if (num_rend_services() > 0) {
+  if (rend_num_services() > 0) {
     rend_consider_services_upload(now);
     rend_consider_descriptor_republication();
   }
@@ -2605,7 +2605,7 @@ int
 hs_service_load_all_keys(void)
 {
   /* Load v2 service keys if we have v2. */
-  if (num_rend_services() != 0) {
+  if (rend_num_services() != 0) {
     if (rend_service_load_all_keys(NULL) < 0) {
       goto err;
     }
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 5f4a7c6a7..7c4c6edc4 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -148,7 +148,7 @@ rend_service_escaped_dir(const struct rend_service_t *s)
 
 /** Return the number of rendezvous services we have configured. */
 int
-num_rend_services(void)
+rend_num_services(void)
 {
   if (!rend_service_list)
     return 0;
diff --git a/src/or/rendservice.h b/src/or/rendservice.h
index 819dfc176..ed1044f04 100644
--- a/src/or/rendservice.h
+++ b/src/or/rendservice.h
@@ -135,7 +135,7 @@ STATIC void rend_service_prune_list_impl_(void);
 
 #endif /* RENDSERVICE_PRIVATE */
 
-int num_rend_services(void);
+int rend_num_services(void);
 int rend_config_service(const config_line_t *line_,
                         const or_options_t *options,
                         hs_service_config_t *config);
diff --git a/src/test/test_hs_config.c b/src/test/test_hs_config.c
index 4d4bbb889..2a85a7db0 100644
--- a/src/test/test_hs_config.c
+++ b/src/test/test_hs_config.c
@@ -453,7 +453,7 @@ test_staging_service_v3(void *arg)
   /* Ok, we have a service in our map! Registration went well. */
   tt_int_op(get_hs_service_staging_list_size(), OP_EQ, 1);
   /* Make sure we don't have a magic v2 service out of this. */
-  tt_int_op(num_rend_services(), OP_EQ, 0);
+  tt_int_op(rend_num_services(), OP_EQ, 0);
 
  done:
   hs_free_all();
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index cb0ae2f45..1b8d8252e 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -279,7 +279,7 @@ test_load_keys(void *arg)
   tt_int_op(ret, OP_EQ, 0);
   /* This one should now be registered into the v2 list. */
   tt_int_op(get_hs_service_staging_list_size(), OP_EQ, 0);
-  tt_int_op(num_rend_services(), OP_EQ, 1);
+  tt_int_op(rend_num_services(), OP_EQ, 1);
 
   /* v3 service. */
   tor_asprintf(&conf, conf_fmt, hsdir_v3, HS_VERSION_THREE);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits