From 391394063f24e1c6b68ee357ad799275fdc56894 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 20 Feb 2009 14:11:15 +0100 Subject: [PATCH] bug 1068: Decompress data when the socket is closed. The reasons why the decompression failed: - the server gave wrong Content-Length - the socket was closed --- src/protocol/http/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index 42bf6369..650b19f3 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -1351,7 +1351,8 @@ read_normal_http_data(struct connection *conn, struct read_buffer *rb) kill_buffer_data(rb, len); - if (!http->length && conn->socket->state == SOCKET_RETRY_ONCLOSE) { + if (!http->length && (conn->socket->state == SOCKET_RETRY_ONCLOSE + || conn->socket->state == SOCKET_CLOSED)) { return 2; } @@ -1366,7 +1367,7 @@ read_http_data(struct socket *socket, struct read_buffer *rb) int ret; if (socket->state == SOCKET_CLOSED) { - if (conn->content_encoding && http->length == -1) { + if (conn->content_encoding) { /* Flush decompression first. */ http->length = 0; } else { -- 2.11.4.GIT