aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.h3
-rw-r--r--src/worker.c5
2 files changed, 7 insertions, 1 deletions
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) {