mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Initialize consdiffmgr when running as (or becoming) a server.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user