aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/cryptobox.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-18 14:48:01 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-18 14:48:01 +0000
commitb33f3fa4cfa42f1b92192ff18eb893b8bd93a1e9 (patch)
treeb147e77e51cfa86b6468a4d721f5d94cd6d820ed /src/libcryptobox/cryptobox.c
parent3cfbb45a4a84836e118992099cea233920b6f92e (diff)
downloadrspamd-b33f3fa4cfa42f1b92192ff18eb893b8bd93a1e9.tar.gz
rspamd-b33f3fa4cfa42f1b92192ff18eb893b8bd93a1e9.zip
Start refcounting rework for rspamd_config
Diffstat (limited to 'src/libcryptobox/cryptobox.c')
-rw-r--r--src/libcryptobox/cryptobox.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c
index 0b9e5ad04..038c94adb 100644
--- a/src/libcryptobox/cryptobox.c
+++ b/src/libcryptobox/cryptobox.c
@@ -62,6 +62,7 @@
unsigned long cpu_config = 0;
static gboolean use_openssl = FALSE;
+static gboolean cryptobox_loaded = FALSE;
static const guchar n0[16] = {0};
@@ -186,6 +187,12 @@ rspamd_cryptobox_init (void)
{
gint cpu[4], nid;
+ if (cryptobox_loaded) {
+ /* Ignore reload attempts */
+ return;
+ }
+
+ cryptobox_loaded = TRUE;
rspamd_cryptobox_cpuid (cpu, 0);
nid = cpu[0];
rspamd_cryptobox_cpuid (cpu, 1);