aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/worker.c16
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