From 229fd540109f92cb8662dd085fcfe46aad3130cf Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 7 Nov 2011 20:03:35 +0300 Subject: Fix main rspamd worker to work with buffer.c changes. --- src/main.h | 3 ++- src/worker.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.h b/src/main.h index fa72c7794..b7531fa83 100644 --- a/src/main.h +++ b/src/main.h @@ -182,7 +182,8 @@ struct worker_task { WRITE_REPLY, WRITE_ERROR, WAIT_FILTER, - CLOSING_CONNECTION + CLOSING_CONNECTION, + WRITING_REPLY } state; /**< current session state */ size_t content_length; /**< length of user's input */ enum rspamd_protocol proto; /**< protocol (rspamc or spamc) */ diff --git a/src/worker.c b/src/worker.c index bd2c5de2e..b3e56c13f 100644 --- a/src/worker.c +++ b/src/worker.c @@ -349,6 +349,7 @@ write_socket (void *arg) switch (task->state) { case WRITE_REPLY: + task->state = WRITING_REPLY; if (!write_reply (task)) { return FALSE; } @@ -359,6 +360,7 @@ write_socket (void *arg) return FALSE; break; case WRITE_ERROR: + task->state = WRITING_REPLY; if (!write_reply (task)) { return FALSE; } @@ -376,6 +378,9 @@ write_socket (void *arg) destroy_session (task->s); return FALSE; break; + case WRITING_REPLY: + /* Do nothing here */ + break; default: msg_info ("abnormally closing connection"); if (ctx->is_custom) { -- cgit v1.2.3