Hans Leidekker : wininet: Don't start reading when POST data hasn' t been completely written.

Alexandre Julliard julliard at winehq.org
Wed Apr 8 10:05:34 CDT 2009


Module: wine
Branch: master
Commit: 3a711fb56b394ffcaf1777c18b3325b4232abefe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3a711fb56b394ffcaf1777c18b3325b4232abefe

Author: Hans Leidekker <hans at meelstraat.net>
Date:   Wed Apr  8 15:22:26 2009 +0200

wininet: Don't start reading when POST data hasn't been completely written.

---

 dlls/wininet/http.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

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-cvs mailing list