aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-12 10:52:33 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-12 10:52:33 +0100
commitedf70f59c11f1877bda35ad0f85889141a89224f (patch)
treead0a9e0fdd0906f616f7ecc62b235bf26f70348a /src/lua
parentcb3a94c63d1d9f39d4bd1f1dbe0c744f6f85ede5 (diff)
downloadrspamd-edf70f59c11f1877bda35ad0f85889141a89224f.tar.gz
rspamd-edf70f59c11f1877bda35ad0f85889141a89224f.zip
[Minor] Skip double message processing
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_task.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index c3159f16b..5be5b3f94 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -1326,11 +1326,19 @@ lua_task_process_message (lua_State *L)
{
LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
+ gboolean enforce = FALSE;
if (task != NULL) {
if (task->msg.len > 0) {
+ if (lua_isboolean (L, 2)) {
+ enforce = lua_toboolean (L, 2);
+ }
+
if (rspamd_message_parse (task)) {
- if (!(task->flags & RSPAMD_TASK_FLAG_SKIP_PROCESS)) {
+ if (enforce ||
+ (!(task->flags & RSPAMD_TASK_FLAG_SKIP_PROCESS) &&
+ !(task->processed_stages & RSPAMD_TASK_STAGE_PROCESS_MESSAGE))) {
+
lua_pushboolean (L, TRUE);
rspamd_message_process (task);
task->processed_stages |= RSPAMD_TASK_STAGE_PROCESS_MESSAGE;