diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-15 18:38:50 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-15 18:38:50 +0000 |
commit | 91d2c0b8425613791ac890e672b34d8d07807ba8 (patch) | |
tree | abcb2a10077106eab89897dcc27b450b446c4c06 | |
parent | 1fa2007b649e0746f452dcf7862961fe4afe5020 (diff) | |
download | rspamd-91d2c0b8425613791ac890e672b34d8d07807ba8.tar.gz rspamd-91d2c0b8425613791ac890e672b34d8d07807ba8.zip |
Fix dispatcher restoration.
-rw-r--r-- | src/controller.c | 7 |
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; |