diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-14 18:27:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-14 18:27:51 +0100 |
commit | ee1e8c27b804061f0e981ddc0b575291e4148c31 (patch) | |
tree | 7ff81a02242c2f5c02026f2ef91bf7b6b274b259 /src/hs_helper.c | |
parent | 590fea4d3ffc85e1a8c57a5d550d7bf46c79eb7d (diff) | |
download | rspamd-ee1e8c27b804061f0e981ddc0b575291e4148c31.tar.gz rspamd-ee1e8c27b804061f0e981ddc0b575291e4148c31.zip |
[Feature] Add common directory for hyperscan cache to config
Diffstat (limited to 'src/hs_helper.c')
-rw-r--r-- | src/hs_helper.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/hs_helper.c b/src/hs_helper.c index 1434f551a..1292d6460 100644 --- a/src/hs_helper.c +++ b/src/hs_helper.c @@ -66,7 +66,7 @@ init_hs_helper (struct rspamd_config *cfg) ctx->magic = rspamd_hs_helper_magic; ctx->cfg = cfg; - ctx->hs_dir = RSPAMD_DBDIR "/"; + ctx->hs_dir = NULL; ctx->max_time = default_max_time; ctx->recompile_time = default_recompile_time; @@ -249,6 +249,14 @@ start_hs_helper (struct rspamd_worker *worker) struct timeval tv; double tim; + + if (ctx->hs_dir == NULL) { + ctx->hs_dir = ctx->cfg->hs_cache_dir; + } + if (ctx->hs_dir == NULL) { + ctx->hs_dir = RSPAMD_DBDIR "/"; + } + ctx->ev_base = rspamd_prepare_worker (worker, "hs_helper", NULL); |