Juan Lang : winhttp: Use proxy server when redirecting.

Alexandre Julliard julliard at winehq.org
Wed Jul 15 09:47:09 CDT 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Tue Jul 14 13:03:52 2009 -0700

winhttp: Use proxy server when redirecting.

---

 dlls/winhttp/request.c         |    7 +++----
 dlls/winhttp/session.c         |    1 -
 dlls/winhttp/winhttp_private.h |    1 +
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 37dd556..85e9b61 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -1158,13 +1158,12 @@ static BOOL handle_redirect( request_t *request )
         hostname[len] = 0;
 
         port = uc.nPort ? uc.nPort : (uc.nScheme == INTERNET_SCHEME_HTTPS ? 443 : 80);
-        if (strcmpiW( connect->servername, hostname ) || connect->serverport != port)
+        if (strcmpiW( connect->hostname, hostname ) || connect->serverport != port)
         {
             heap_free( connect->hostname );
             connect->hostname = hostname;
-            heap_free( connect->servername );
-            connect->servername = strdupW( connect->hostname );
-            connect->serverport = connect->hostport = port;
+            connect->hostport = port;
+            if (!(ret = set_server_for_hostname( connect, hostname, port ))) goto end;
 
             netconn_close( &request->netconn );
             if (!(ret = netconn_init( &request->netconn, request->hdr.flags & WINHTTP_FLAG_SECURE ))) goto end;
diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
index 5d2466e..b09e887 100644
--- a/dlls/winhttp/session.c
+++ b/dlls/winhttp/session.c
@@ -316,7 +316,6 @@ static BOOL should_bypass_proxy(session_t *session, LPCWSTR server)
     return ret;
 }
 
-static
 BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT port )
 {
     session_t *session = connect->session;
diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h
index 2143953..2431d7c 100644
--- a/dlls/winhttp/winhttp_private.h
+++ b/dlls/winhttp/winhttp_private.h
@@ -221,6 +221,7 @@ BOOL set_cookies( request_t *, const WCHAR * );
 BOOL add_cookie_headers( request_t * );
 BOOL add_request_headers( request_t *, LPCWSTR, DWORD, DWORD );
 void delete_domain( domain_t * );
+BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT port );
 
 static inline void *heap_alloc( SIZE_T size )
 {




More information about the wine-cvs mailing list