From 31545206fb6be070c223c42b85bf3143867d6a63 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Tue, 14 Jul 2009 13:03:52 -0700 Subject: [PATCH] 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 37dd5561318..85e9b6116f3 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 5d2466eac5c..b09e887e856 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 2143953c034..2431d7ce9c9 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 ) {