summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-04-13 10:51:59 -0400
committerNick Mathewson <nickm@torproject.org>2018-04-13 10:54:26 -0400
commit03b96882deb60cd21c3c77746f4f9cd4aac0a724 (patch)
treedc9f65dc453aa4d0eb468e74880fded889f4bd8e /src/or/main.c
parentb152d62cee7480ee7b9b68dd9b619db65b6cd112 (diff)
downloadtor-03b96882deb60cd21c3c77746f4f9cd4aac0a724.tar.gz
tor-03b96882deb60cd21c3c77746f4f9cd4aac0a724.zip
Rename token_bucket_t to token_bucket_rw_t.
This is a simple search-and-replace to rename the token bucket type to indicate that it contains both a read and a write bucket, bundled with their configuration. It's preliminary to refactoring the bucket type.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 0e67ea6f68..2ad915c5f8 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -154,10 +154,10 @@ static void shutdown_did_not_work_callback(evutil_socket_t fd, short event,
/********* START VARIABLES **********/
/* Token bucket for all traffic. */
-token_bucket_t global_bucket;
+token_bucket_rw_t global_bucket;
/* Token bucket for relayed traffic. */
-token_bucket_t global_relayed_bucket;
+token_bucket_rw_t global_relayed_bucket;
/** What was the read/write bucket before the last second_elapsed_callback()
* call? (used to determine how many bytes we've read). */
@@ -2390,9 +2390,9 @@ refill_callback(periodic_timer_t *timer, void *arg)
}
bytes_written = stats_prev_global_write_bucket -
- token_bucket_get_write(&global_bucket);
+ token_bucket_rw_get_write(&global_bucket);
bytes_read = stats_prev_global_read_bucket -
- token_bucket_get_read(&global_bucket);
+ token_bucket_rw_get_read(&global_bucket);
stats_n_bytes_read += bytes_read;
stats_n_bytes_written += bytes_written;
@@ -2404,8 +2404,8 @@ refill_callback(periodic_timer_t *timer, void *arg)
monotime_coarse_get_stamp());
}
- stats_prev_global_read_bucket = token_bucket_get_read(&global_bucket);
- stats_prev_global_write_bucket = token_bucket_get_write(&global_bucket);
+ stats_prev_global_read_bucket = token_bucket_rw_get_read(&global_bucket);
+ stats_prev_global_write_bucket = token_bucket_rw_get_write(&global_bucket);
/* remember what time it is, for next time */
refill_timer_current_millisecond = now;
@@ -2609,8 +2609,8 @@ do_main_loop(void)
/* Set up our buckets */
connection_bucket_init();
- stats_prev_global_read_bucket = token_bucket_get_read(&global_bucket);
- stats_prev_global_write_bucket = token_bucket_get_write(&global_bucket);
+ stats_prev_global_read_bucket = token_bucket_rw_get_read(&global_bucket);
+ stats_prev_global_write_bucket = token_bucket_rw_get_write(&global_bucket);
/* initialize the bootstrap status events to know we're starting up */
control_event_bootstrap(BOOTSTRAP_STATUS_STARTING, 0);