diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-18 17:50:40 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-18 17:50:40 +0100 |
commit | 319e6580b67bdc8eb7fc4920c49f6e0ae4bad6c4 (patch) | |
tree | ced9afcc9a5e450af2bf984e311da7ff4d57686d /src/libserver | |
parent | 40e2310e6546325b79f38ef41f258284fe5c1b01 (diff) | |
download | rspamd-319e6580b67bdc8eb7fc4920c49f6e0ae4bad6c4.tar.gz rspamd-319e6580b67bdc8eb7fc4920c49f6e0ae4bad6c4.zip |
Fix writing reply to a client.
Issue: #94
Reported by: @jpastuszek
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/protocol.c | 2 | ||||
-rw-r--r-- | src/libserver/task.c | 1 | ||||
-rw-r--r-- | src/libserver/task.h | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index ac41dca0c..26efc9b7c 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -855,7 +855,7 @@ rspamd_protocol_write_reply (struct rspamd_task *task) } msg->date = time (NULL); - task->state = CLOSING_CONNECTION; + task->state = WRITING_REPLY; debug_task ("writing reply to client"); if (task->error_code != 0) { diff --git a/src/libserver/task.c b/src/libserver/task.c index 860bb2b03..8eb0c7932 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -335,6 +335,7 @@ rspamd_task_process (struct rspamd_task *task, /* Call write_socket to write reply and exit */ task->state = WRITE_REPLY; } + task->s->wanna_die = TRUE; } else { rspamd_lua_call_pre_filters (task); diff --git a/src/libserver/task.h b/src/libserver/task.h index bf14d2174..2fd634e54 100644 --- a/src/libserver/task.h +++ b/src/libserver/task.h @@ -69,6 +69,7 @@ struct rspamd_task { WAIT_FILTER, WAIT_POST_FILTER, WRITE_REPLY, + WRITING_REPLY, CLOSING_CONNECTION } state; /**< current session state */ enum rspamd_command cmd; /**< command */ |