Hans Leidekker : wininet: Only reconnect when redirected to an external site.

Alexandre Julliard julliard at winehq.org
Mon Jun 30 08:27:39 CDT 2008


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

Author: Hans Leidekker <hans at meelstraat.net>
Date:   Sun Jun 29 16:03:39 2008 +0200

wininet: Only reconnect when redirected to an external site.

---

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

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index fdfd9da..5e527a1 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1329,8 +1329,6 @@ static BOOL HTTP_ResolveName(LPWININETHTTPREQW lpwhr)
     char szaddr[32];
     LPWININETHTTPSESSIONW lpwhs = lpwhr->lpHttpSession;
 
-    if (lpwhs->socketAddress.sin_addr.s_addr) return TRUE;
-
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_RESOLVING_NAME,
                           lpwhs->lpszServerName,
@@ -3019,17 +3017,16 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl)
 
         if (!using_proxy)
         {
-            HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName);
-            lpwhs->lpszServerName = WININET_strdupW(hostName);
-            lpwhs->nServerPort = urlComponents.nPort;
-
-            if (!HTTP_ResolveName(lpwhr))
-                return FALSE;
-
-            NETCON_close(&lpwhr->netConnection);
+            if (strcmpiW(lpwhs->lpszServerName, hostName) || lpwhs->nServerPort != urlComponents.nPort)
+            {
+                HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName);
+                lpwhs->lpszServerName = WININET_strdupW(hostName);
+                lpwhs->nServerPort = urlComponents.nPort;
 
-            if (!NETCON_init(&lpwhr->netConnection,lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE))
-                return FALSE;
+                NETCON_close(&lpwhr->netConnection);
+                if (!HTTP_ResolveName(lpwhr)) return FALSE;
+                if (!NETCON_init(&lpwhr->netConnection, lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)) return FALSE;
+            }
         }
         else
             TRACE("Redirect through proxy\n");




More information about the wine-cvs mailing list