aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-22 10:24:21 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-07-22 10:24:21 +0100
commitc4055be5894c40807e24009afef04830f2f74fcb (patch)
tree589607fa3ac540a8d53e4177f51474af8e6ce025 /src/libserver/cfg_utils.c
parent74f6d73a40512220b05a7f0e0d6f5558a58b2146 (diff)
downloadrspamd-c4055be5894c40807e24009afef04830f2f74fcb.tar.gz
rspamd-c4055be5894c40807e24009afef04830f2f74fcb.zip
[Feature] Dynamically detect if a CPU is incompatible with hyperscan
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r--src/libserver/cfg_utils.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 709ce2adb..81cf06adf 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -644,7 +644,18 @@ rspamd_config_post_load (struct rspamd_config *cfg,
#endif
rspamd_regexp_library_init ();
- rspamd_multipattern_library_init (cfg->hs_cache_dir);
+ rspamd_multipattern_library_init (cfg->hs_cache_dir,
+ cfg->libs_ctx->crypto_ctx);
+
+#ifdef WITH_HYPERSCAN
+ if (!cfg->disable_hyperscan) {
+ if (!(cfg->libs_ctx->crypto_ctx->cpu_config & CPUID_SSSE3)) {
+ msg_warn_config ("CPU doesn't have SSSE3 instructions set "
+ "required for hyperscan, disable it");
+ cfg->disable_hyperscan = TRUE;
+ }
+ }
+#endif
if ((def_metric =
g_hash_table_lookup (cfg->metrics, DEFAULT_METRIC)) == NULL) {