winhttp: Process end of read data before sending callback in read_data().

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2021-10-15 16:59:49 +03:00 committed by Alexandre Julliard
parent d349013dde
commit 3a8ccb9242

View file

@ -1848,6 +1848,7 @@ static DWORD read_data( struct request *request, void *buffer, DWORD size, DWORD
done:
TRACE( "retrieved %u bytes (%u/%u)\n", bytes_read, request->content_read, request->content_length );
if (end_of_read_data( request )) finished_reading( request );
if (async)
{
if (!ret) send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, buffer, bytes_read );
@ -1861,7 +1862,6 @@ done:
}
if (!ret && read) *read = bytes_read;
if (end_of_read_data( request )) finished_reading( request );
return ret;
}