diff options
author | unixninja92 <charles@unixninja92.com> | 2016-01-03 23:02:44 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-01-08 15:52:10 -0800 |
commit | 4f0e28977d6376ccba599e7089aeb9e3b4f25e5f (patch) | |
tree | 4eab9c52a3395e7976cb36335031e5caa55adf26 /src/or/router.c | |
parent | cdbb04be102969bd2cece9daf42896e061cc8880 (diff) | |
download | tor-4f0e28977d6376ccba599e7089aeb9e3b4f25e5f.tar.gz tor-4f0e28977d6376ccba599e7089aeb9e3b4f25e5f.zip |
Added AccountRule in and AccountingRule out options
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c index 2081bdb06a..c94dca951b 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1133,10 +1133,13 @@ router_should_be_directory_server(const or_options_t *options, int dir_port) int new_choice=1; const char *reason = NULL; - if (accounting_is_enabled(options)) { + if (accounting_is_enabled(options) && + get_options()->AccountingRule != ACCT_IN) { /* Don't spend bytes for directory traffic if we could end up hibernating, * but allow DirPort otherwise. Some people set AccountingMax because - * they're confused or to get statistics. */ + * they're confused or to get statistics. Directory traffic has a much + * larger effect on output than input so there is no reason to turn it + * off if using AccountingRule in. */ int interval_length = accounting_get_interval_length(); uint32_t effective_bw = get_effective_bwrate(options); uint64_t acc_bytes; |