From a610f4aabc39d0c9c7a5a12f3fdef7d5ac0cd52a Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Thu, 8 May 2008 02:05:11 -0700 Subject: [PATCH] Bug 422172 - ""Automatic proxy configuration URL" reload button does not work" [p=hugues.fournier@gmail.com (Hugues Fournier) r+sr=biesi a1.9=beltzner] --- netwerk/base/src/nsProtocolProxyService.cpp | 11 ++++++----- netwerk/base/src/nsProtocolProxyService.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/netwerk/base/src/nsProtocolProxyService.cpp b/netwerk/base/src/nsProtocolProxyService.cpp index 3b6f4990a49..937fb334e1e 100644 --- a/netwerk/base/src/nsProtocolProxyService.cpp +++ b/netwerk/base/src/nsProtocolProxyService.cpp @@ -498,7 +498,7 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch, mSystemProxySettings->GetPACURI(tempString); } if (!tempString.IsEmpty()) - ConfigureFromPAC(tempString); + ConfigureFromPAC(tempString, PR_FALSE); } } @@ -758,7 +758,8 @@ nsProtocolProxyService::IsProxyDisabled(nsProxyInfo *pi) } nsresult -nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec) +nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec, + PRBool forceReload) { if (!mPACMan) { mPACMan = new nsPACMan(); @@ -771,7 +772,7 @@ nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec) if (NS_FAILED(rv)) return rv; - if (mPACMan->IsPACURI(pacURI)) + if (mPACMan->IsPACURI(pacURI) && !forceReload) return NS_OK; mFailedProxies.Clear(); @@ -826,7 +827,7 @@ nsProtocolProxyService::ReloadPAC() pacSpec.AssignLiteral(WPAD_URL); if (!pacSpec.IsEmpty()) - ConfigureFromPAC(pacSpec); + ConfigureFromPAC(pacSpec, PR_TRUE); return NS_OK; } @@ -1256,7 +1257,7 @@ nsProtocolProxyService::Resolve_Internal(nsIURI *uri, !PACURI.IsEmpty()) { // Switch to new PAC file if that setting has changed. If the setting // hasn't changed, ConfigureFromPAC will exit early. - nsresult rv = ConfigureFromPAC(PACURI); + nsresult rv = ConfigureFromPAC(PACURI, PR_FALSE); if (NS_FAILED(rv)) return rv; } else { diff --git a/netwerk/base/src/nsProtocolProxyService.h b/netwerk/base/src/nsProtocolProxyService.h index 97bb49af805..f7d19e16ddc 100644 --- a/netwerk/base/src/nsProtocolProxyService.h +++ b/netwerk/base/src/nsProtocolProxyService.h @@ -114,7 +114,7 @@ protected: * @param pacURI * The URI spec of the PAC file to load. */ - NS_HIDDEN_(nsresult) ConfigureFromPAC(const nsCString &pacURI); + NS_HIDDEN_(nsresult) ConfigureFromPAC(const nsCString &pacURI, PRBool forceReload); /** * This method builds a list of nsProxyInfo objects from the given PAC-