[tor-commits] [tor/master] Rename connection_bucket_refill to connection_bucket_refill_all

nickm at torproject.org nickm at torproject.org
Mon Apr 23 13:48:35 UTC 2018


commit 1356d51af62f839bb29eb150e6cb37edcef24d4f
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Apr 17 11:46:23 2018 -0400

    Rename connection_bucket_refill to connection_bucket_refill_all
    
    Also document its actual behavior
---
 src/or/connection.c | 5 +++--
 src/or/connection.h | 4 ++--
 src/or/main.c       | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index 1e308e9b4..631d665af 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -3178,9 +3178,10 @@ connection_bucket_adjust(const or_options_t *options)
   }
 }
 
-/** Time has passed; increment buckets appropriately. */
+/** Time has passed; increment buckets appropriately and re-enable formerly
+ * blocked connections. */
 void
-connection_bucket_refill(time_t now, uint32_t now_ts)
+connection_bucket_refill_all(time_t now, uint32_t now_ts)
 {
   smartlist_t *conns = get_connection_array();
 
diff --git a/src/or/connection.h b/src/or/connection.h
index 83e2bd543..a2dce2435 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -123,8 +123,8 @@ ssize_t connection_bucket_write_limit(connection_t *conn, time_t now);
 int global_write_bucket_low(connection_t *conn, size_t attempt, int priority);
 void connection_bucket_init(void);
 void connection_bucket_adjust(const or_options_t *options);
-void connection_bucket_refill(time_t now,
-                              uint32_t now_ts);
+void connection_bucket_refill_all(time_t now,
+                                  uint32_t now_ts);
 void connection_read_bw_exhausted(connection_t *conn, bool is_global_bw);
 void connection_write_bw_exhausted(connection_t *conn, bool is_global_bw);
 void connection_consider_empty_read_buckets(connection_t *conn);
diff --git a/src/or/main.c b/src/or/main.c
index e21ef24f8..3217e2d9b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2407,8 +2407,8 @@ refill_callback(periodic_timer_t *timer, void *arg)
     accounting_add_bytes(bytes_read, bytes_written, seconds_rolled_over);
 
   if (milliseconds_elapsed > 0) {
-    connection_bucket_refill((time_t)now.tv_sec,
-                             monotime_coarse_get_stamp());
+    connection_bucket_refill_all((time_t)now.tv_sec,
+                                 monotime_coarse_get_stamp());
   }
 
   stats_prev_global_read_bucket = token_bucket_rw_get_read(&global_bucket);





More information about the tor-commits mailing list