aboutsummaryrefslogtreecommitdiffstats
path: root/src/controller.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller.c')
-rw-r--r--src/controller.c7
1 files 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;