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

[tor-commits] [tor/master] Make a bunch of networkstatus_t parameters constant.



commit 93ccb3294bd2af4587d11e7306422a9aef83013c
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Jun 24 14:28:43 2020 -0400

    Make a bunch of networkstatus_t parameters constant.
    
    This is part of refactoring our "notify the rest of the code that we
    have a new consensus" code.
---
 src/core/or/channelpadding.c    | 2 +-
 src/core/or/channelpadding.h    | 3 +--
 src/core/or/circuitstats.c      | 4 ++--
 src/core/or/circuitstats.h      | 2 +-
 src/feature/nodelist/nodelist.c | 4 ++--
 src/feature/nodelist/nodelist.h | 4 ++--
 6 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/core/or/channelpadding.c b/src/core/or/channelpadding.c
index be2ce78a1..c754a58c4 100644
--- a/src/core/or/channelpadding.c
+++ b/src/core/or/channelpadding.c
@@ -90,7 +90,7 @@ static int consensus_nf_pad_single_onion;
  * for every single connection, every second.
  */
 void
-channelpadding_new_consensus_params(networkstatus_t *ns)
+channelpadding_new_consensus_params(const networkstatus_t *ns)
 {
 #define DFLT_NETFLOW_INACTIVE_KEEPALIVE_LOW 1500
 #define DFLT_NETFLOW_INACTIVE_KEEPALIVE_HIGH 9500
diff --git a/src/core/or/channelpadding.h b/src/core/or/channelpadding.h
index d1c7192ff..9246988cd 100644
--- a/src/core/or/channelpadding.h
+++ b/src/core/or/channelpadding.h
@@ -37,7 +37,6 @@ int channelpadding_send_enable_command(channel_t *chan, uint16_t low_timeout,
 
 int channelpadding_get_circuits_available_timeout(void);
 unsigned int channelpadding_get_channel_idle_timeout(const channel_t *, int);
-void channelpadding_new_consensus_params(networkstatus_t *ns);
+void channelpadding_new_consensus_params(const networkstatus_t *ns);
 
 #endif /* !defined(TOR_CHANNELPADDING_H) */
-
diff --git a/src/core/or/circuitstats.c b/src/core/or/circuitstats.c
index 6a9d84df9..bc6c26379 100644
--- a/src/core/or/circuitstats.c
+++ b/src/core/or/circuitstats.c
@@ -399,7 +399,7 @@ circuit_build_times_initial_timeout(void)
  * and learn a new timeout.
  */
 static int32_t
-circuit_build_times_recent_circuit_count(networkstatus_t *ns)
+circuit_build_times_recent_circuit_count(const networkstatus_t *ns)
 {
   int32_t num;
   num = networkstatus_get_param(ns, "cbtrecentcount",
@@ -425,7 +425,7 @@ circuit_build_times_recent_circuit_count(networkstatus_t *ns)
  */
 void
 circuit_build_times_new_consensus_params(circuit_build_times_t *cbt,
-                                         networkstatus_t *ns)
+                                         const networkstatus_t *ns)
 {
   int32_t num;
 
diff --git a/src/core/or/circuitstats.h b/src/core/or/circuitstats.h
index 317eeac20..930e0a9ba 100644
--- a/src/core/or/circuitstats.h
+++ b/src/core/or/circuitstats.h
@@ -43,7 +43,7 @@ int circuit_build_times_needs_circuits_now(const circuit_build_times_t *cbt);
 void circuit_build_times_init(circuit_build_times_t *cbt);
 void circuit_build_times_free_timeouts(circuit_build_times_t *cbt);
 void circuit_build_times_new_consensus_params(circuit_build_times_t *cbt,
-                                              networkstatus_t *ns);
+                                              const networkstatus_t *ns);
 double circuit_build_times_timeout_rate(const circuit_build_times_t *cbt);
 double circuit_build_times_close_rate(const circuit_build_times_t *cbt);
 
diff --git a/src/feature/nodelist/nodelist.c b/src/feature/nodelist/nodelist.c
index 6b2c0d201..dd6c65661 100644
--- a/src/feature/nodelist/nodelist.c
+++ b/src/feature/nodelist/nodelist.c
@@ -621,7 +621,7 @@ get_estimated_address_per_node, (void))
  * and grab microdescriptors into nodes as appropriate.
  */
 void
-nodelist_set_consensus(networkstatus_t *ns)
+nodelist_set_consensus(const networkstatus_t *ns)
 {
   const or_options_t *options = get_options();
   int authdir = authdir_mode_v3(options);
@@ -952,7 +952,7 @@ nodelist_assert_ok(void)
 /** Ensure that the nodelist has been created with the most recent consensus.
  *  If that's not the case, make it so.  */
 void
-nodelist_ensure_freshness(networkstatus_t *ns)
+nodelist_ensure_freshness(const networkstatus_t *ns)
 {
   tor_assert(ns);
 
diff --git a/src/feature/nodelist/nodelist.h b/src/feature/nodelist/nodelist.h
index 4ba699d69..826d1b957 100644
--- a/src/feature/nodelist/nodelist.h
+++ b/src/feature/nodelist/nodelist.h
@@ -32,8 +32,8 @@ const node_t *node_get_by_hex_id(const char *identity_digest,
                                  unsigned flags);
 node_t *nodelist_set_routerinfo(routerinfo_t *ri, routerinfo_t **ri_old_out);
 node_t *nodelist_add_microdesc(microdesc_t *md);
-void nodelist_set_consensus(networkstatus_t *ns);
-void nodelist_ensure_freshness(networkstatus_t *ns);
+void nodelist_set_consensus(const networkstatus_t *ns);
+void nodelist_ensure_freshness(const networkstatus_t *ns);
 int nodelist_probably_contains_address(const tor_addr_t *addr);
 void nodelist_add_addr4_to_address_set(const uint32_t addr);
 void nodelist_add_addr6_to_address_set(const tor_addr_t *addr);



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