mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-30 03:26:23 -04:00
Fallback to the raw deflate only when nothing was decompressed so far.
It lets view the site from bug 1017.
This commit is contained in:
parent
391394063f
commit
3131de4767
@ -124,7 +124,8 @@ deflate_read(struct stream_encoded *stream, unsigned char *buf, int len)
|
|||||||
}
|
}
|
||||||
restart:
|
restart:
|
||||||
err = inflate(&data->deflate_stream, Z_SYNC_FLUSH);
|
err = inflate(&data->deflate_stream, Z_SYNC_FLUSH);
|
||||||
if (err == Z_DATA_ERROR && !data->after_first_read) {
|
if (err == Z_DATA_ERROR && !data->after_first_read
|
||||||
|
&& data->deflate_stream.next_out == buf) {
|
||||||
/* RFC 2616 requires a zlib header for
|
/* RFC 2616 requires a zlib header for
|
||||||
* "Content-Encoding: deflate", but some HTTP
|
* "Content-Encoding: deflate", but some HTTP
|
||||||
* servers (Microsoft-IIS/6.0 at blogs.msdn.com,
|
* servers (Microsoft-IIS/6.0 at blogs.msdn.com,
|
||||||
@ -159,7 +160,8 @@ restart:
|
|||||||
data->last_read = 1;
|
data->last_read = 1;
|
||||||
break;
|
break;
|
||||||
} else if (err != Z_OK) {
|
} else if (err != Z_OK) {
|
||||||
return -1;
|
data->last_read = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} while (data->deflate_stream.avail_out > 0);
|
} while (data->deflate_stream.avail_out > 0);
|
||||||
|
|
||||||
|
@ -1057,7 +1057,6 @@ decompress_data(struct connection *conn, unsigned char *data, int len,
|
|||||||
int *length_of_block;
|
int *length_of_block;
|
||||||
unsigned char *output = NULL;
|
unsigned char *output = NULL;
|
||||||
|
|
||||||
|
|
||||||
if (http->length == LEN_CHUNKED) {
|
if (http->length == LEN_CHUNKED) {
|
||||||
if (http->chunk_remaining == CHUNK_ZERO_SIZE)
|
if (http->chunk_remaining == CHUNK_ZERO_SIZE)
|
||||||
state = FINISHING;
|
state = FINISHING;
|
||||||
|
Loading…
Reference in New Issue
Block a user