aboutsummaryrefslogtreecommitdiff
path: root/src/app/config/config.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-10-30 15:38:23 +1000
committerteor <teor@torproject.org>2019-10-31 12:34:20 +1000
commit1d4d2deea1987171dea64bf3e563b24194b6ac84 (patch)
tree1b894e2687dd977dc699b6c229d30ed556dc9758 /src/app/config/config.c
parentfc5da4ad048af372b7765aa0d10acba05bc6d2dc (diff)
downloadtor-1d4d2deea1987171dea64bf3e563b24194b6ac84.tar.gz
tor-1d4d2deea1987171dea64bf3e563b24194b6ac84.zip
config: Move dirauth stats actions into the module
This commit: * moves dirauth stats and mtbf config actions into dirauth_config, * adds thin wrappers to make the moved code compile. The moved code is disabled when the dirauth module is disabled. Part of 32213.
Diffstat (limited to 'src/app/config/config.c')
-rw-r--r--src/app/config/config.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 4dc023c1a5..901ed92e57 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -106,7 +106,6 @@
#include "feature/rend/rendservice.h"
#include "lib/geoip/geoip.h"
#include "feature/stats/geoip_stats.h"
-#include "feature/stats/rephist.h"
#include "lib/compress/compress.h"
#include "lib/confmgt/structvar.h"
#include "lib/crypt_ops/crypto_init.h"
@@ -1897,7 +1896,8 @@ options_act,(const or_options_t *old_options))
if (! or_state_loaded() && running_tor) {
if (or_state_load())
return -1;
- rep_hist_load_mtbf_data(time(NULL));
+ if (options_act_dirauth_mtbf(options) < 0)
+ return -1;
}
/* 31851: some of the code in these functions is relay-only */
@@ -2131,21 +2131,10 @@ options_act,(const or_options_t *old_options))
}
bool print_notice = 0;
- if (options->BridgeAuthoritativeDir) {
- time_t now = time(NULL);
-
- if ((!old_options || !old_options->BridgeAuthoritativeDir) &&
- options->BridgeAuthoritativeDir) {
- rep_hist_desc_stats_init(now);
- print_notice = 1;
- }
-
- if (old_options && old_options->BridgeAuthoritativeDir &&
- !options->BridgeAuthoritativeDir)
- rep_hist_desc_stats_term();
-
if (options_act_relay_stats(old_options, &print_notice) < 0)
return -1;
+ if (options_act_dirauth_stats(old_options, &print_notice) < 0)
+ return -1;
if (print_notice)
options_act_relay_stats_msg();