diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-23 08:34:22 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-29 09:05:11 -0400 |
commit | 8527a2996675d9502551ccdd4224036a45aae47b (patch) | |
tree | 9b2ab6a02949da52b42b5b1b1b4cd7a29465e778 /src/or/config.c | |
parent | e6150c7fc079d7841bedd0df838b29aef0f497d7 (diff) | |
download | tor-8527a2996675d9502551ccdd4224036a45aae47b.tar.gz tor-8527a2996675d9502551ccdd4224036a45aae47b.zip |
Add an "AccountingRule" feature to permit limiting bw usage by read+write
Patch from "chobe". Closes ticket 961.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 16acec791c..c7c61549ae 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -126,6 +126,7 @@ static config_abbrev_t option_abbrevs_[] = { */ static config_var_t option_vars_[] = { V(AccountingMax, MEMUNIT, "0 bytes"), + V(AccountingRule, STRING, "max"), V(AccountingStart, STRING, NULL), V(Address, STRING, NULL), V(AllowDotExit, BOOL, "0"), @@ -3108,6 +3109,10 @@ options_validate(or_options_t *old_options, or_options_t *options, "risky: they will all turn off at the same time, which may " "alert observers that they are being run by the same party."); } + if (options->AccountingRule && + strcmp(options->AccountingRule, "sum") != 0 && + strcmp(options->AccountingRule, "max") != 0) + REJECT("AccountingRule must be 'sum' or 'max'"); } if (options->HTTPProxy) { /* parse it now */ |