wininet: Don't peek data in InternetQueryDataAvailable if there is no more to be expected.
This commit is contained in:
parent
fb4901759b
commit
662f44a619
|
@ -3325,8 +3325,8 @@ BOOL WINAPI InternetQueryDataAvailable( HINTERNET hFile,
|
||||||
* to peek only a single byte in async mode. */
|
* to peek only a single byte in async mode. */
|
||||||
BOOL async = (lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC);
|
BOOL async = (lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC);
|
||||||
if (!NETCON_recv(&lpwhr->netConnection, buffer,
|
if (!NETCON_recv(&lpwhr->netConnection, buffer,
|
||||||
async ? 1 : min(sizeof(buffer),
|
min(async ? 1 : sizeof(buffer),
|
||||||
lpwhr->dwContentLength - lpwhr->dwContentRead),
|
lpwhr->dwContentLength - lpwhr->dwContentRead),
|
||||||
MSG_PEEK, (int *)lpdwNumberOfBytesAvailble))
|
MSG_PEEK, (int *)lpdwNumberOfBytesAvailble))
|
||||||
{
|
{
|
||||||
INTERNET_SetLastError(ERROR_NO_MORE_FILES);
|
INTERNET_SetLastError(ERROR_NO_MORE_FILES);
|
||||||
|
|
Loading…
Reference in New Issue