Fix two problems with chunked gzipped HTTP replies.

* receiveEnd is set in a different place in case of chunked transfers,
which would cause the decompressor to never be flushed.
* In the case of chunked transfers, we call Flush() without any input
data (to flush only whatever is remaining in the decompression buffer).
This causes ZLib to return Z_BUF_ERROR which is translated to
B_BUFFER_OVERFLOW. This is a non-fatal error and is expected behavior in
that case. Don't handle this as an error, and do use the extracted data.

Fixes various cases of missing the last chunk of a page (pastie.org,
Google search results, and more).
This commit is contained in:
Adrien Destugues
2014-07-21 11:49:42 +02:00
parent 7cd7f2fbf3
commit 9f7d29b05e
2 changed files with 106 additions and 99 deletions
+1
View File
@@ -68,6 +68,7 @@ private:
void _SendRequest();
void _SendHeaders();
void _SendPostData();
status_t _GetLine(BString& destString);