diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-10 13:45:58 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-10 13:45:58 +0100 |
commit | ff7dc7361fb03972ce8a3d05dc126a5fe263c149 (patch) | |
tree | 604b1c73573011e439dc6b793ed4bfaabba5b1ec | |
parent | 3f3e6a3ebf7137a632e5cfa71421c3eb5898c638 (diff) | |
download | rspamd-ff7dc7361fb03972ce8a3d05dc126a5fe263c149.tar.gz rspamd-ff7dc7361fb03972ce8a3d05dc126a5fe263c149.zip |
[Fix] Initialize sqlite3 properly
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/rspamd.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 049d77d30..2afc8443f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,8 +46,6 @@ OPTION(ENABLE_GPERF_TOOLS "Enable google perftools [default: OFF]" OPTION(ENABLE_STATIC "Enable static compiling [default: OFF]" OFF) OPTION(ENABLE_LUAJIT "Link with libluajit [default: ON]" ON) OPTION(ENABLE_DB "Find and link with DB library [default: OFF]" OFF) -OPTION(ENABLE_SQLITE "Find and link with sqlite3 library [default: OFF]" OFF) -OPTION(ENABLE_HIREDIS "Find and link with external redis library [default: ON]" ON) OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) OPTION(NO_SHARED "Build internal libs static [default: ON]" ON) OPTION(INSTALL_EXAMPLES "Install examples [default: OFF]" OFF) diff --git a/src/rspamd.c b/src/rspamd.c index 6d676b968..ea7df3eee 100644 --- a/src/rspamd.c +++ b/src/rspamd.c @@ -58,6 +58,8 @@ #include <openssl/evp.h> #endif +#include "sqlite3.h" + /* 2 seconds to fork new process in place of dead one */ #define SOFT_FORK_TIME 2 @@ -1314,6 +1316,8 @@ main (gint argc, gchar **argv, gchar **env) return res ? EXIT_SUCCESS : EXIT_FAILURE; } + sqlite3_initialize (); + /* Load config */ if (!load_rspamd_config (rspamd_main, rspamd_main->cfg, TRUE, RSPAMD_CONFIG_LOAD_ALL, FALSE)) { @@ -1526,6 +1530,7 @@ main (gint argc, gchar **argv, gchar **env) g_free (rspamd_main); event_base_free (ev_base); + sqlite3_shutdown (); if (control_addr) { rspamd_inet_address_free (control_addr); |