Module: wine Branch: master Commit: 685daf2006f8b6619206e33b28a65df4ec414386 URL: http://source.winehq.org/git/wine.git/?a=commit;h=685daf2006f8b6619206e33b28...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Mar 17 01:01:49 2011 +0100
wininet: Ensure that we have data to report before sending INTERNET_STATUS_REQUEST_COMPLETE in HTTP_HttpEndRequestW.
---
dlls/wininet/http.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 7e27531..9444f08 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -4333,7 +4333,6 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_ { INT responseLen; DWORD dwBufferSize; - INTERNET_ASYNC_RESULT iar; DWORD res = ERROR_SUCCESS;
INTERNET_SendCallback(&request->hdr, request->hdr.dwContext, @@ -4382,12 +4381,16 @@ static DWORD HTTP_HttpEndRequestW(http_request_t *request, DWORD dwFlags, DWORD_ } }
- iar.dwResult = (res==ERROR_SUCCESS ? (DWORD_PTR)request->hdr.hInternet : 0); - iar.dwError = res; + if (res == ERROR_SUCCESS) { + HTTP_ReceiveRequestData(request, TRUE); + }else { + INTERNET_ASYNC_RESULT iar = {0, res}; + + INTERNET_SendCallback(&request->hdr, request->hdr.dwContext, + INTERNET_STATUS_REQUEST_COMPLETE, &iar, + sizeof(INTERNET_ASYNC_RESULT)); + }
- INTERNET_SendCallback(&request->hdr, request->hdr.dwContext, - INTERNET_STATUS_REQUEST_COMPLETE, &iar, - sizeof(INTERNET_ASYNC_RESULT)); return res; }