[PATCH 5/7] wininet: Don't send callbacks in HTTP_CloseConnection if not connected.

Robert Shearman rob at codeweavers.com
Thu Jan 4 12:21:42 CST 2007


---
  dlls/wininet/http.c |   11 +++++------
  1 files changed, 5 insertions(+), 6 deletions(-)
-------------- next part --------------
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index d7e1d33..7fa0566 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -2925,16 +2925,16 @@ static VOID HTTP_CloseConnection(LPWININ
 
     TRACE("%p\n",lpwhr);
 
+    if (!NETCON_connected(&lpwhr->netConnection))
+        return;
+
     lpwhs = lpwhr->lpHttpSession;
     hIC = lpwhs->lpAppInfo;
 
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);
 
-    if (NETCON_connected(&lpwhr->netConnection))
-    {
-        NETCON_close(&lpwhr->netConnection);
-    }
+    NETCON_close(&lpwhr->netConnection);
 
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_CONNECTION_CLOSED, 0, 0);
@@ -2956,8 +2956,7 @@ static void HTTP_CloseHTTPRequestHandle(
 
     WININET_Release(&lpwhr->hdr);
 
-    if (NETCON_connected(&lpwhr->netConnection))
-        HTTP_CloseConnection(lpwhr);
+    HTTP_CloseConnection(lpwhr);
 
     HeapFree(GetProcessHeap(), 0, lpwhr->lpszPath);
     HeapFree(GetProcessHeap(), 0, lpwhr->lpszVerb);


More information about the wine-patches mailing list