Commit fba8d7b2 authored by Nick Mathewson's avatar Nick Mathewson 🎨
Browse files

Initialize consdiffmgr when running as (or becoming) a server.

parent 24f70597
......@@ -74,6 +74,7 @@
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
#include "consdiffmgr.h"
#include "control.h"
#include "confparse.h"
#include "cpuworker.h"
......@@ -1815,6 +1816,15 @@ options_act(const or_options_t *old_options)
return -1;
}
if (server_mode(options)) {
static int cdm_initialized = 0;
if (cdm_initialized == 0) {
cdm_initialized = 1;
consdiffmgr_configure(NULL);
consdiffmgr_validate();
}
}
if (init_control_cookie_authentication(options->CookieAuthentication) < 0) {
log_warn(LD_CONFIG,"Error creating control cookie authentication file.");
return -1;
......
......@@ -622,7 +622,8 @@ consdiffmgr_cleanup(void)
void
consdiffmgr_configure(const consdiff_cfg_t *cfg)
{
memcpy(&consdiff_cfg, cfg, sizeof(consdiff_cfg));
if (cfg)
memcpy(&consdiff_cfg, cfg, sizeof(consdiff_cfg));
(void) cdm_cache_get();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment