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

This commit is contained in:
Misha Koshelev 2007-08-12 15:38:05 -05:00 committed by Alexandre Julliard
parent fb4901759b
commit 662f44a619
1 changed files with 2 additions and 2 deletions

View File

@ -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);