From 6b1d8321aef15a948ec32333a98217450bd02f78 Mon Sep 17 00:00:00 2001 From: Florian Tschorsch Date: Wed, 7 Sep 2011 20:21:53 -0400 Subject: New torrc option to allow bucket refill intervals of less than 1 sec Implements bug3630. --- src/or/config.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/or/config.c') diff --git a/src/or/config.c b/src/or/config.c index bc77b3a77..b04cee4c1 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -386,6 +386,7 @@ static config_var_t _option_vars[] = { OBSOLETE("SysLog"), V(TestSocks, BOOL, "0"), OBSOLETE("TestVia"), + V(TokenBucketRefillInterval, MSEC_INTERVAL, "10 msec"), V(TrackHostExits, CSV, NULL), V(TrackHostExitsExpire, INTERVAL, "30 minutes"), OBSOLETE("TrafficShaping"), @@ -1382,6 +1383,13 @@ options_act(const or_options_t *old_options) if (accounting_is_enabled(options)) configure_accounting(time(NULL)); + if (options->TokenBucketRefillInterval < 0 + || options->TokenBucketRefillInterval > 1000) { + log_warn(LD_CONFIG, "Token bucket refill interval must be in the range " + "of [0:1000]"); + return -1; + } + #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. */ -- cgit v1.2.3