1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

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
This commit is contained in:
Witold Filipczyk 2009-02-20 14:11:15 +01:00 committed by Witold Filipczyk
parent c8cee1df61
commit 53ab6d493e

View File

@ -1306,7 +1306,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;
}
@ -1321,7 +1322,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 {