diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-22 17:27:05 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-09-22 17:27:05 +0100 |
commit | 17e0a0778389ab4741747beb8cae5eedab0327a3 (patch) | |
tree | 8b1eecb667ce58959e750fddea81e5d9a712ef31 /src/worker.c | |
parent | 05a46b8f2181daf06170613ce382c0c7ba58c7ad (diff) | |
download | rspamd-17e0a0778389ab4741747beb8cae5eedab0327a3.tar.gz rspamd-17e0a0778389ab4741747beb8cae5eedab0327a3.zip |
Implement the proper reset of HTTP messages.
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/worker.c b/src/worker.c index 26e59ace2..30da517fe 100644 --- a/src/worker.c +++ b/src/worker.c @@ -141,7 +141,7 @@ rspamd_worker_error_handler (struct rspamd_http_connection *conn, GError *err) msg_info ("abnormally closing connection from: %s, error: %s", rspamd_inet_address_to_string (&task->client_addr), err->message); - if (task->state != CLOSING_CONNECTION && task->state != WRITING_REPLY) { + if (task->state != WRITING_REPLY && task->state != CLOSING_CONNECTION) { /* We still need to write a reply */ task->error_code = err->code; task->last_error = @@ -161,12 +161,13 @@ rspamd_worker_finish_handler (struct rspamd_http_connection *conn, { struct rspamd_task *task = (struct rspamd_task *) conn->ud; - if (task->state == CLOSING_CONNECTION) { + if (msg->type == HTTP_RESPONSE) { + /* We are done here */ msg_debug ("normally closing connection from: %s", rspamd_inet_address_to_string (&task->client_addr)); destroy_session (task->s); } - else if (task->state != WRITING_REPLY) { + else { /* * If all filters have finished their tasks, this function will trigger * writing a reply. @@ -174,12 +175,6 @@ rspamd_worker_finish_handler (struct rspamd_http_connection *conn, task->s->wanna_die = TRUE; check_session_pending (task->s); } - else { - /* - * We are going to write a reply to a client - */ - task->state = CLOSING_CONNECTION; - } return 0; } |