[3/5] wininet: Don't start reading when POST data hasn't been completely written.

Hans Leidekker hans at meelstraat.net
Wed Apr 8 08:22:26 CDT 2009


diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index c35badc..3777d4c 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -3513,10 +3513,23 @@ lend:
 
     /* TODO: send notification for P3P header */
 
-    if(lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC) {
-        if(bSuccess) {
-            HTTP_ReceiveRequestData(lpwhr, TRUE);
-        }else {
+    if (lpwhr->lpHttpSession->lpAppInfo->hdr.dwFlags & INTERNET_FLAG_ASYNC)
+    {
+        if (bSuccess)
+        {
+            if (lpwhr->dwBytesWritten == lpwhr->dwBytesToWrite) HTTP_ReceiveRequestData(lpwhr, TRUE);
+            else
+            {
+                iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet;
+                iar.dwError = 0;
+
+                INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
+                                  INTERNET_STATUS_REQUEST_COMPLETE, &iar,
+                                  sizeof(INTERNET_ASYNC_RESULT));
+            }
+        }
+        else
+        {
             iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet;
             iar.dwError = INTERNET_GetLastError();
 



More information about the wine-patches mailing list