From 662f44a619c2261486ce27cee66bf49c99629029 Mon Sep 17 00:00:00 2001 From: Misha Koshelev Date: Sun, 12 Aug 2007 15:38:05 -0500 Subject: [PATCH] wininet: Don't peek data in InternetQueryDataAvailable if there is no more to be expected. --- dlls/wininet/internet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index aa74c7cd71..14cfd04548 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -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); -- 2.32.0.93.g670b81a890