diff options
author | Florian Tschorsch <tschorsch@informatik.uni-wuerzburg.de> | 2011-09-07 20:21:53 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-09-22 15:07:23 -0400 |
commit | 6b1d8321aef15a948ec32333a98217450bd02f78 (patch) | |
tree | f7718bf89f468c1635ff64216947e3316e901fc1 /src/or/config.c | |
parent | 40288e1e66b82fc0a641afeaad5d102f001f3df1 (diff) | |
download | tor-6b1d8321aef15a948ec32333a98217450bd02f78.tar.gz tor-6b1d8321aef15a948ec32333a98217450bd02f78.zip |
New torrc option to allow bucket refill intervals of less than 1 sec
Implements bug3630.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index bc77b3a77e..b04cee4c1f 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. */ |