[tor-commits] [tor/master] Make rate_limited and is_rate_limited a bool

nickm at torproject.org nickm at torproject.org
Tue Apr 23 18:14:23 UTC 2019


commit 943559b18066e126652450df4402dca74ba1baa0
Author: Neel Chauhan <neel at neelc.org>
Date:   Fri Apr 19 08:33:00 2019 -0400

    Make rate_limited and is_rate_limited a bool
---
 src/feature/hs/hs_common.c    | 4 ++--
 src/feature/hs/hs_common.h    | 2 +-
 src/feature/rend/rendclient.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c
index cffec2b87..a14ff6a64 100644
--- a/src/feature/hs/hs_common.c
+++ b/src/feature/hs/hs_common.c
@@ -1598,14 +1598,14 @@ hs_purge_last_hid_serv_requests(void)
  *  NULL if no HSDirs are worth trying right now. */
 routerstatus_t *
 hs_pick_hsdir(smartlist_t *responsible_dirs, const char *req_key_str,
-              int *is_rate_limited)
+              bool *is_rate_limited)
 {
   smartlist_t *usable_responsible_dirs = smartlist_new();
   const or_options_t *options = get_options();
   routerstatus_t *hs_dir;
   time_t now = time(NULL);
   int excluded_some;
-  int rate_limited;
+  bool rate_limited;
   int rate_limited_count = 0;
   int responsible_dirs_count = smartlist_len(responsible_dirs);
 
diff --git a/src/feature/hs/hs_common.h b/src/feature/hs/hs_common.h
index f96fc8beb..fc0c39f94 100644
--- a/src/feature/hs/hs_common.h
+++ b/src/feature/hs/hs_common.h
@@ -241,7 +241,7 @@ void hs_get_responsible_hsdirs(const struct ed25519_public_key_t *blinded_pk,
                               int use_second_hsdir_index,
                               int for_fetching, smartlist_t *responsible_dirs);
 routerstatus_t *hs_pick_hsdir(smartlist_t *responsible_dirs,
-                              const char *req_key_str, int *is_rate_limited);
+                              const char *req_key_str, bool *is_rate_limited);
 
 time_t hs_hsdir_requery_period(const or_options_t *options);
 time_t hs_lookup_last_hid_serv_request(routerstatus_t *hs_dir,
diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index 9863fc1c1..090722a4c 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -469,7 +469,7 @@ directory_get_from_hs_dir(const char *desc_id,
 
   /* Automatically pick an hs dir if none given. */
   if (!rs_hsdir) {
-    int rate_limited;
+    bool rate_limited;
 
     /* Determine responsible dirs. Even if we can't get all we want, work with
      * the ones we have. If it's empty, we'll notice in hs_pick_hsdir(). */





More information about the tor-commits mailing list