From 1d4d2deea1987171dea64bf3e563b24194b6ac84 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 30 Oct 2019 15:38:23 +1000 Subject: 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. --- src/app/config/config.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/app/config/config.c') 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(); -- cgit v1.2.3-54-g00ecf