]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not destroy session when not all finish scripts are done
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Feb 2017 13:14:59 +0000 (13:14 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Feb 2017 13:14:59 +0000 (13:14 +0000)
src/worker.c

index 12a6acf2cd9b2773917e6f914467b337128f9a5e..5995911b9ccab6623c691d5ef17f556b8b4e53d3 100644 (file)
@@ -101,6 +101,7 @@ rspamd_worker_call_finish_handlers (struct rspamd_worker *worker)
                task = rspamd_task_new (worker, cfg);
                task->resolver = ctx->resolver;
                task->ev_base = ctx->ev_base;
+               task->flags |= RSPAMD_TASK_FLAG_PROCESSING;
                task->s = rspamd_session_create (task->task_pool,
                                rspamd_worker_finalize,
                                NULL,
@@ -111,6 +112,8 @@ rspamd_worker_call_finish_handlers (struct rspamd_worker *worker)
                        lua_call_finish_script (cfg->lua_state, sc, task);
                }
 
+               task->flags &= ~RSPAMD_TASK_FLAG_PROCESSING;
+
                if (rspamd_session_pending (task->s)) {
                        return TRUE;
                }