diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-16 13:33:19 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-16 13:33:19 +0100 |
commit | 05f0988bbeb067106837becb20340fbc82e9fcca (patch) | |
tree | 362d83373cea57506bef5830f98dc8016343ad6b | |
parent | 2182188ba963d5ee9345696932c479d2c9076fea (diff) | |
download | rspamd-05f0988bbeb067106837becb20340fbc82e9fcca.tar.gz rspamd-05f0988bbeb067106837becb20340fbc82e9fcca.zip |
Add workaround for #296.
-rw-r--r-- | src/worker.c | 16 |
1 files changed, 12 insertions, 4 deletions
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 |