aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-02-22 13:59:34 -0500
committerNick Mathewson <nickm@torproject.org>2010-09-27 14:22:18 -0400
commitffd5070b04b3db4409d8e3dc933ffc7d12b5219d (patch)
treef1fcfa7d71f88f9b005637aa6df804d61f1f3085 /src/or/config.c
parent98ec959c9c1d2b0a872926a3cafe42742520397a (diff)
downloadtor-ffd5070b04b3db4409d8e3dc933ffc7d12b5219d.tar.gz
tor-ffd5070b04b3db4409d8e3dc933ffc7d12b5219d.zip
Convert bufferevents to use rate-limiting.
This requires the latest Git version of Libevent as of 24 March 2010. In the future, we'll just say it requires Libevent 2.0.5-alpha or later. Since Libevent doesn't yet support hierarchical rate limit groups, there isn't yet support for tracking relayed-bytes separately when using the bufferevent system. If a future version does add support for hierarchical buckets, we can add that back in.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 8febe7a56b..fa2eb73beb 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1231,6 +1231,17 @@ options_act(or_options_t *old_options)
if (accounting_is_enabled(options))
configure_accounting(time(NULL));
+#ifdef USE_BUFFEREVENTS
+ /* If we're using the bufferevents implementation and our rate limits
+ * changed, we need to tell the rate-limiting system about it. */
+ if (!old_options ||
+ old_options->BandwidthRate != options->BandwidthRate ||
+ old_options->BandwidthBurst != options->BandwidthBurst ||
+ old_options->RelayBandwidthRate != options->RelayBandwidthRate ||
+ old_options->RelayBandwidthBurst != options->RelayBandwidthBurst)
+ connection_bucket_init();
+#endif
+
/* Change the cell EWMA settings */
cell_ewma_set_scale_factor(options, networkstatus_get_latest_consensus());