From: Vsevolod Stakhov Date: Thu, 16 Feb 2017 13:14:59 +0000 (+0000) Subject: [Fix] Do not destroy session when not all finish scripts are done X-Git-Tag: 1.5.0~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dd2a849dbb5349c3412395d0a8eb0334b8b4a07e;p=rspamd.git [Fix] Do not destroy session when not all finish scripts are done --- diff --git a/src/worker.c b/src/worker.c index 12a6acf2c..5995911b9 100644 --- a/src/worker.c +++ b/src/worker.c @@ -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; }