diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-15 17:27:34 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-15 17:27:34 +0000 |
commit | 23208fb40ca7c0b18d26c739e2861491f0f42abb (patch) | |
tree | 2319fcf2d7dc646f9b6c5f03af2e12e6ddf9e033 /src | |
parent | 803a9062065ccf7a3dde90db5adb872e86d4be5b (diff) | |
download | rspamd-23208fb40ca7c0b18d26c739e2861491f0f42abb.tar.gz rspamd-23208fb40ca7c0b18d26c739e2861491f0f42abb.zip |
[Minor] Init utf8 library
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c index 264101376..9c788587a 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -86,6 +86,7 @@ #include "cryptobox.h" #include "zlib.h" #include "contrib/uthash/utlist.h" +#include "contrib/fastutf8/fastutf8.h" /* Check log messages intensity once per minute */ #define CHECK_TIME 60 @@ -2334,6 +2335,18 @@ rspamd_init_libs (void) #endif } + /* Configure utf8 library */ + guint utf8_flags = 0; + + if ((ctx->crypto_ctx->cpu_config & CPUID_SSE41)) { + utf8_flags |= RSPAMD_FAST_UTF8_FLAG_SSE41; + } + if ((ctx->crypto_ctx->cpu_config & CPUID_AVX2)) { + utf8_flags |= RSPAMD_FAST_UTF8_FLAG_AVX2; + } + + rspamd_fast_utf8_library_init (utf8_flags); + g_assert (ottery_init (ottery_cfg) == 0); #ifdef HAVE_LOCALE_H |