From df14dbbf466c8b4a17175ffb3c58599eb790fd3d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 12 Jul 2016 16:39:34 +0100 Subject: [PATCH] [Fix] Fix settings application --- src/libserver/symbols_cache.c | 8 +------- src/libserver/symbols_cache.h | 9 +++++++++ src/lua/lua_task.c | 2 ++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 11ecc3249..4bed6ad3a 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -1333,7 +1333,7 @@ rspamd_symbols_cache_make_checkpoint (struct rspamd_task *task, return checkpoint; } -static gboolean +gboolean rspamd_symbols_cache_process_settings (struct rspamd_task *task, struct symbols_cache *cache) { @@ -1448,12 +1448,6 @@ rspamd_symbols_cache_process_symbols (struct rspamd_task * task, checkpoint = task->checkpoint; } - if (task->settings) { - if (rspamd_symbols_cache_process_settings (task, cache)) { - return TRUE; - } - } - msg_debug_task ("symbols processing stage at pass: %d", checkpoint->pass); start_events_pending = rspamd_session_events_pending (task->s); diff --git a/src/libserver/symbols_cache.h b/src/libserver/symbols_cache.h index 2c7738ed2..1a4c0c3ed 100644 --- a/src/libserver/symbols_cache.h +++ b/src/libserver/symbols_cache.h @@ -222,4 +222,13 @@ struct rspamd_abstract_callback_data* rspamd_symbols_cache_get_cbdata ( gboolean rspamd_symbols_cache_set_cbdata (struct symbols_cache *cache, const gchar *symbol, struct rspamd_abstract_callback_data *cbdata); +/** + * Process settings for task + * @param task + * @param cache + * @return + */ +gboolean rspamd_symbols_cache_process_settings (struct rspamd_task *task, + struct symbols_cache *cache); + #endif diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 29f2f1046..c7e446a24 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2811,6 +2811,8 @@ lua_task_set_settings (lua_State *L) } } } + + rspamd_symbols_cache_process_settings (task, task->cfg->cache); } else { return luaL_error (L, "invalid arguments"); -- 2.39.5