From: Vsevolod Stakhov Date: Tue, 16 Jun 2015 12:33:19 +0000 (+0100) Subject: Add workaround for #296. X-Git-Tag: 0.9.6~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=05f0988bbeb067106837becb20340fbc82e9fcca;p=rspamd.git Add workaround for #296. --- diff --git a/src/worker.c b/src/worker.c index 7c72b0515..59da744d0 100644 --- a/src/worker.c +++ b/src/worker.c @@ -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