Commit 662f44a6 authored by Misha Koshelev's avatar Misha Koshelev Committed by Alexandre Julliard

wininet: Don't peek data in InternetQueryDataAvailable if there is no more to be expected.

parent fb490175
......@@ -3325,8 +3325,8 @@ BOOL WINAPI InternetQueryDataAvailable( HINTERNET hFile,
* to peek only a single byte in async mode. */
BOOL async = (lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC);
if (!NETCON_recv(&lpwhr->netConnection, buffer,
async ? 1 : min(sizeof(buffer),
lpwhr->dwContentLength - lpwhr->dwContentRead),
min(async ? 1 : sizeof(buffer),
lpwhr->dwContentLength - lpwhr->dwContentRead),
MSG_PEEK, (int *)lpdwNumberOfBytesAvailble))
{
INTERNET_SetLastError(ERROR_NO_MORE_FILES);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment