winhttp: Call read_data() at least once in drain_content().

This ensures that response headers are processed even if there's no data to read.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50244
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2021-09-23 14:58:26 +02:00 committed by Alexandre Julliard
parent b645d4f5b3
commit 239964ce86
1 changed files with 2 additions and 5 deletions

View File

@ -1877,11 +1877,8 @@ static void drain_content( struct request *request )
for (;;)
{
if (request->read_chunked) size = sizeof(buffer);
else
{
if (bytes_total >= bytes_left) return;
size = min( sizeof(buffer), bytes_left - bytes_total );
}
else size = min( sizeof(buffer), bytes_left - bytes_total );
if (read_data( request, buffer, size, &bytes_read, FALSE ) || !bytes_read) return;
bytes_total += bytes_read;
}