diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-11-02 23:47:32 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-11-02 23:47:32 +0000 |
commit | 8db0abb687a379906828ac252b7da3c0cd7b20c1 (patch) | |
tree | caeca53c34e54db6dc7c374e9c0669cc88bfa178 /src/or/config.c | |
parent | a2f6210b3e1a7ff261855981fc06031f78cba8f4 (diff) | |
download | tor-8db0abb687a379906828ac252b7da3c0cd7b20c1.tar tor-8db0abb687a379906828ac252b7da3c0cd7b20c1.tar.gz |
First attempt at hibernation code. It needs more work around the XXXXs, but first I want arma to review the basic approach while I meditate on how to fix them.
svn:r2649
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index 1b3fa09ba..6ae4be189 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -112,6 +112,8 @@ static config_var_t config_vars[] = { OBSOLETE("LinkPadding"), VAR("MaxConn", UINT, MaxConn), VAR("MaxOnionsPending", UINT, MaxOnionsPending), + VAR("MonthlyAccountingStart",UINT, AccountingStart), + VAR("AccountingMaxKB", UINT, AccountingMaxKB), VAR("Nickname", STRING, Nickname), VAR("NewCircuitPeriod", UINT, NewCircuitPeriod), VAR("NumCpus", UINT, NumCpus), @@ -384,7 +386,7 @@ config_assign(or_options_t *options, struct config_line_t *list) return -1; list = list->next; } - + return 0; } @@ -962,6 +964,15 @@ getconfig(int argc, char **argv, or_options_t *options) result = -1; } + if (options->AccountingStart < 0 || options->AccountingStart > 31) { + log(LOG_WARN,"Monthy accounting must start on a day of the month, and no months have %d days.", + options->AccountingStart); + result = -1; + } else if (options->AccountingStart > 28) { + log(LOG_WARN,"Not every month has %d days.",options->AccountingStart); + result = -1; + } + if (options->HttpProxy) { /* parse it now */ if (parse_addr_port(options->HttpProxy, NULL, &options->HttpProxyAddr, &options->HttpProxyPort) < 0) { |