# Local networks
local_addrs = "192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, fd00::/8, 169.254.0.0/16, fe80::/10";
+hs_cache_dir = "${DBDIR}/";
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;
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);
gchar * tld_file; /**< file to load effective tld list from */
+ gchar * hs_cache_dir; /**< directory to save hyperscan databases */
+
gdouble dns_timeout; /**< timeout in milliseconds for waiting for dns reply */
guint32 dns_retransmits; /**< maximum retransmits count */
guint32 dns_throttling_errors; /**< maximum errors for starting resolver throttling */
G_STRUCT_OFFSET (struct rspamd_config, tld_file),
RSPAMD_CL_FLAG_STRING_PATH,
"Path to the TLD file for urls detector");
+ rspamd_rcl_add_default_handler (sub,
+ "hs_cache_dir",
+ rspamd_rcl_parse_struct_string,
+ G_STRUCT_OFFSET (struct rspamd_config, hs_cache_dir),
+ RSPAMD_CL_FLAG_STRING_PATH,
+ "Path directory where rspamd would save hyperscan cache");
rspamd_rcl_add_default_handler (sub,
"history_rows",
rspamd_rcl_parse_struct_integer,