summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-04-30 10:27:22 -0400
committerNick Mathewson <nickm@torproject.org>2018-04-30 10:27:22 -0400
commit3800d5916f90b11df433c885fae94f1dc7edca5c (patch)
tree15cf9f7e0863eebbc6f341a0f1b5f93b68246d1e /src/or/main.c
parentb205061eb13abd68a5335f8008c5121ef230c34e (diff)
parent868e348570911c52534132bc245a8fea07b42934 (diff)
downloadtor-3800d5916f90b11df433c885fae94f1dc7edca5c.tar.gz
tor-3800d5916f90b11df433c885fae94f1dc7edca5c.zip
Merge remote-tracking branch 'dgoulet/ticket25900_034_01'
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 10f26c954e..797969646b 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1386,7 +1386,6 @@ STATIC periodic_event_item_t periodic_events[] = {
CALLBACK(check_for_reachability_bw, PERIODIC_EVENT_ROLE_ROUTER,
PERIODIC_EVENT_FLAG_NEED_NET),
CALLBACK(check_onion_keys_expiry_time, PERIODIC_EVENT_ROLE_ROUTER, 0),
- CALLBACK(clean_consdiffmgr, PERIODIC_EVENT_ROLE_ROUTER, 0),
CALLBACK(expire_old_ciruits_serverside, PERIODIC_EVENT_ROLE_ROUTER,
PERIODIC_EVENT_FLAG_NEED_NET),
CALLBACK(retry_dns, PERIODIC_EVENT_ROLE_ROUTER, 0),
@@ -1420,6 +1419,9 @@ STATIC periodic_event_item_t periodic_events[] = {
/* Bridge Authority only. */
CALLBACK(write_bridge_ns, PERIODIC_EVENT_ROLE_BRIDGEAUTH, 0),
+ /* Directory server only. */
+ CALLBACK(clean_consdiffmgr, PERIODIC_EVENT_ROLE_DIRSERVER, 0),
+
END_OF_PERIODIC_EVENTS
};
#undef CALLBACK
@@ -1476,6 +1478,7 @@ get_my_roles(const or_options_t *options)
int is_bridgeauth = authdir_mode_bridge(options);
int is_hidden_service = !!hs_service_get_num_services() ||
!!rend_num_services();
+ int is_dirserver = dir_server_mode(options);
if (is_bridge) roles |= PERIODIC_EVENT_ROLE_BRIDGE;
if (is_client) roles |= PERIODIC_EVENT_ROLE_CLIENT;
@@ -1483,6 +1486,7 @@ get_my_roles(const or_options_t *options)
if (is_dirauth) roles |= PERIODIC_EVENT_ROLE_DIRAUTH;
if (is_bridgeauth) roles |= PERIODIC_EVENT_ROLE_BRIDGEAUTH;
if (is_hidden_service) roles |= PERIODIC_EVENT_ROLE_HS_SERVICE;
+ if (is_dirserver) roles |= PERIODIC_EVENT_ROLE_DIRSERVER;
return roles;
}
@@ -2341,7 +2345,7 @@ static int
clean_consdiffmgr_callback(time_t now, const or_options_t *options)
{
(void)now;
- if (server_mode(options)) {
+ if (dir_server_mode(options)) {
consdiffmgr_cleanup();
}
return CDM_CLEAN_CALLBACK_INTERVAL;