]> source.dussan.org Git - rspamd.git/commitdiff
Add workaround for #296.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Jun 2015 12:33:19 +0000 (13:33 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 16 Jun 2015 12:33:19 +0000 (13:33 +0100)
src/worker.c

index 7c72b05159533c53cdab3cd85a6c58a2fd66c04c..59da744d082b7a778b6fa54cd20d602a98683d8a 100644 (file)
@@ -132,10 +132,9 @@ rspamd_worker_body_handler (struct rspamd_http_connection *conn,
                return 0;
        }
 
-
-       if (!rspamd_task_process (task, msg, chunk, len, ctx->classify_pool, TRUE)) {
-               task->state = WRITE_REPLY;
-       }
+       task->state = READ_MESSAGE;
+       task->msg.start = chunk;
+       task->msg.len = len;
 
        return 0;
 }
@@ -175,6 +174,15 @@ rspamd_worker_finish_handler (struct rspamd_http_connection *conn,
                /* Forcefully set the state */
                task->state = CLOSING_CONNECTION;
        }
+       else if (task->state == READ_MESSAGE) {
+               task->state = WRITE_REPLY;
+               if (!rspamd_task_process (task, msg, task->msg.start, task->msg.len,
+                               NULL, TRUE)) {
+                       rspamd_protocol_write_reply (task);
+               }
+               task->s->wanna_die = TRUE;
+               check_session_pending (task->s);
+       }
        else {
                /*
                 * If all filters have finished their tasks, this function will trigger