Commit 9a5c0461 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Move INTERNET_STATUS_REQUEST_COMPLETE call from INTERNET_ReadFile.

parent d3682dd3
......@@ -729,8 +729,7 @@ static void HTTP_DrainContent(LPWININETHTTPREQW lpwhr)
do
{
char buffer[2048];
if (!INTERNET_ReadFile(&lpwhr->hdr, buffer, sizeof(buffer), &bytes_read,
TRUE, FALSE))
if (!INTERNET_ReadFile(&lpwhr->hdr, buffer, sizeof(buffer), &bytes_read, TRUE))
return;
} while (bytes_read);
}
......
......@@ -1700,8 +1700,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer,
BOOL INTERNET_ReadFile(LPWININETHANDLEHEADER lpwh, LPVOID lpBuffer,
DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead,
BOOL bWait, BOOL bSendCompletionStatus)
DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead, BOOL bWait)
{
BOOL retval = FALSE;
int nSocket = -1;
......@@ -1765,18 +1764,6 @@ BOOL INTERNET_ReadFile(LPWININETHANDLEHEADER lpwh, LPVOID lpBuffer,
break;
}
if (bSendCompletionStatus)
{
INTERNET_ASYNC_RESULT iar;
iar.dwResult = retval;
iar.dwError = iar.dwError = retval ? ERROR_SUCCESS :
INTERNET_GetLastError();
INTERNET_SendCallback(lpwh, lpwh->dwContext,
INTERNET_STATUS_REQUEST_COMPLETE, &iar,
sizeof(INTERNET_ASYNC_RESULT));
}
return retval;
}
......@@ -1805,7 +1792,7 @@ BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer,
return FALSE;
}
retval = INTERNET_ReadFile(lpwh, lpBuffer, dwNumOfBytesToRead, pdwNumOfBytesRead, TRUE, FALSE);
retval = INTERNET_ReadFile(lpwh, lpBuffer, dwNumOfBytesToRead, pdwNumOfBytesRead, TRUE);
WININET_Release( lpwh );
TRACE("-- %s (bytes read: %d)\n", retval ? "TRUE": "FALSE", pdwNumOfBytesRead ? *pdwNumOfBytesRead : -1);
......@@ -1842,12 +1829,21 @@ BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer,
void AsyncInternetReadFileExProc(WORKREQUEST *workRequest)
{
struct WORKREQ_INTERNETREADFILEEXA const *req = &workRequest->u.InternetReadFileExA;
INTERNET_ASYNC_RESULT iar;
BOOL res;
TRACE("INTERNETREADFILEEXA %p\n", workRequest->hdr);
INTERNET_ReadFile(workRequest->hdr, req->lpBuffersOut->lpvBuffer,
res = INTERNET_ReadFile(workRequest->hdr, req->lpBuffersOut->lpvBuffer,
req->lpBuffersOut->dwBufferLength,
&req->lpBuffersOut->dwBufferLength, TRUE, TRUE);
&req->lpBuffersOut->dwBufferLength, TRUE);
iar.dwResult = res;
iar.dwError = res ? ERROR_SUCCESS : INTERNET_GetLastError();
INTERNET_SendCallback(workRequest->hdr, workRequest->hdr->dwContext,
INTERNET_STATUS_REQUEST_COMPLETE, &iar,
sizeof(INTERNET_ASYNC_RESULT));
}
BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOut,
......@@ -1907,7 +1903,7 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu
retval = INTERNET_ReadFile(lpwh, lpBuffersOut->lpvBuffer,
lpBuffersOut->dwBufferLength, &lpBuffersOut->dwBufferLength,
!(dwFlags & IRF_NO_WAIT), FALSE);
!(dwFlags & IRF_NO_WAIT));
if (retval)
{
......
......@@ -404,7 +404,7 @@ LPSTR INTERNET_GetResponseBuffer(void);
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen);
BOOL INTERNET_ReadFile(LPWININETHANDLEHEADER lpwh, LPVOID lpBuffer,
DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead,
BOOL bWait, BOOL bSendCompletionStatus);
BOOL bWait);
BOOLAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD_PTR dwContext);
......
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