From 91d2c0b8425613791ac890e672b34d8d07807ba8 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Nov 2013 18:38:50 +0000 Subject: [PATCH] Fix dispatcher restoration. --- src/controller.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controller.c b/src/controller.c index 8af87c5a4..b5aba9b90 100644 --- a/src/controller.c +++ b/src/controller.c @@ -1477,8 +1477,11 @@ controller_read_socket (f_str_t * in, void *arg) task->s = new_async_session (task->task_pool, fin_learn_task, restore_learn_task, free_task_hard, task); task->dispatcher = session->dispatcher; session->learn_task = task; + session->state = STATE_LEARN_SPAM; + rspamd_dispatcher_pause (session->dispatcher); r = process_filters (task); if (r == -1) { + rspamd_dispatcher_restore (session->dispatcher); session->state = STATE_REPLY; if (session->restful) { r = rspamd_snprintf (out_buf, sizeof (out_buf), "HTTP/1.0 500 Cannot process message" CRLF CRLF); @@ -1498,10 +1501,6 @@ controller_read_socket (f_str_t * in, void *arg) } } } - else { - session->state = STATE_LEARN_SPAM; - rspamd_dispatcher_pause (session->dispatcher); - } break; case STATE_WEIGHTS: session->learn_buf = in; -- 2.39.5