wininet: Try to read reamaining data in chunked_drain_content.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-08-17 19:09:21 +02:00 committed by Alexandre Julliard
parent 2ecdac8846
commit 90b936f0b2
1 changed files with 9 additions and 0 deletions

View File

@ -2823,6 +2823,15 @@ static DWORD chunked_read(data_stream_t *stream, http_request_t *req, BYTE *buf,
static DWORD chunked_drain_content(data_stream_t *stream, http_request_t *req)
{
chunked_stream_t *chunked_stream = (chunked_stream_t*)stream;
BYTE buf[1024];
DWORD size, res;
while(chunked_stream->state != CHUNKED_STREAM_STATE_END_OF_STREAM) {
res = chunked_read(stream, req, buf, sizeof(buf), &size, FALSE);
if(res != ERROR_SUCCESS)
return res;
}
if(chunked_stream->state != CHUNKED_STREAM_STATE_END_OF_STREAM)
return ERROR_NO_DATA;
return ERROR_SUCCESS;