mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05: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:
parent
c8cee1df61
commit
53ab6d493e
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user