[PATCH 0/1] MR10665: winhttp: Read as much data as possible in WinHttpReadData().
From: Hans Leidekker <hans@codeweavers.com> --- dlls/winhttp/request.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 947ef839da6..9a8546c2e6d 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -3475,11 +3475,16 @@ BOOL WINAPI WinHttpQueryDataAvailable( HINTERNET hrequest, LPDWORD available ) return !ret || ret == ERROR_IO_PENDING; } -static DWORD read_data( struct request *request, void *buffer, DWORD size, DWORD *read, BOOL async ) +static DWORD read_data( struct request *request, char *buffer, DWORD size, DWORD *read, BOOL async ) { - DWORD bytes_read = 0, ret; + DWORD bytes_read = 0, count, ret = ERROR_SUCCESS; - ret = read_data_stream( request, buffer, size, &bytes_read ); + while (size) + { + if ((ret = read_data_stream( request, buffer + bytes_read, size, &count )) || !count) break; + bytes_read += count; + size -= count; + } TRACE( "%lu bytes read\n", bytes_read ); if (end_of_data_stream( request )) finished_reading( request ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10665
participants (2)
-
Hans Leidekker -
Hans Leidekker (@hans)