aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-30 13:11:10 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-30 13:11:10 +0100
commit58550f6fcb6ca819d8e7f184aba2da409d6972f6 (patch)
tree59d5d2da25dfaaf077848c457f7495422e27298c /src
parent8d271079beaf5c6e69eced2a234f59a83208717e (diff)
downloadrspamd-58550f6fcb6ca819d8e7f184aba2da409d6972f6.tar.gz
rspamd-58550f6fcb6ca819d8e7f184aba2da409d6972f6.zip
[Minor] Initialize composite policy when defined from Lua
Diffstat (limited to 'src')
-rw-r--r--src/fuzzy_storage.c8
-rw-r--r--src/lua/lua_config.c3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index f248d928f..cd0266844 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -550,8 +550,8 @@ rspamd_fuzzy_updates_cb (gboolean success,
}
msg_info ("successfully updated fuzzy storage: %d updates in queue; "
- "%d pending currently; "
- "%d added, %d deleted, %d extended, %d duplicates",
+ "%d pending currently; "
+ "%d added, %d deleted, %d extended, %d duplicates",
cbdata->updates_pending->len,
ctx->updates_pending->len,
nadded, ndeleted, nextended, nignored);
@@ -562,7 +562,7 @@ rspamd_fuzzy_updates_cb (gboolean success,
else {
if (++ctx->updates_failed > ctx->updates_maxfail) {
msg_err ("cannot commit update transaction to fuzzy backend, discard "
- "%ud updates after %d retries",
+ "%ud updates after %d retries",
cbdata->updates_pending->len,
ctx->updates_maxfail);
ctx->updates_failed = 0;
@@ -609,7 +609,7 @@ rspamd_fuzzy_process_updates_queue (struct rspamd_fuzzy_storage_ctx *ctx,
cbdata->updates_pending = ctx->updates_pending;
ctx->updates_pending = g_array_sized_new (FALSE, FALSE,
sizeof (struct fuzzy_peer_cmd),
- MAX (ctx->updates_pending->len, 1024));
+ MAX (cbdata->updates_pending->len, 1024));
cbdata->source = g_strdup (source);
rspamd_fuzzy_backend_process_updates (ctx->backend,
cbdata->updates_pending,
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 35b7dc332..41e323753 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -2272,7 +2272,8 @@ lua_config_add_composite (lua_State * L)
msg_warn_config ("composite %s is redefined", name);
new = FALSE;
}
- composite = rspamd_mempool_alloc (cfg->cfg_pool,
+
+ composite = rspamd_mempool_alloc0 (cfg->cfg_pool,
sizeof (struct rspamd_composite));
composite->expr = expr;
composite->id = g_hash_table_size (cfg->composite_symbols);