]> source.dussan.org Git - rspamd.git/commitdiff
Fix dispatcher restoration.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Nov 2013 18:38:50 +0000 (18:38 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Nov 2013 18:38:50 +0000 (18:38 +0000)
src/controller.c

index 8af87c5a4eb25dc1230a50f1d84a744fed55dc21..b5aba9b90c48e7eceaffa0af92c69427e5735dcb 100644 (file)
@@ -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;