From 983f5622373f10afa230fe700cd56e326b021657 Mon Sep 17 00:00:00 2001 From: "edburns%acm.org" Date: Sat, 3 Feb 2001 02:56:28 +0000 Subject: [PATCH] bug 49336 r=av sr=waterson This code makes sure that if the prefs say to USE DIRECT instead of using a proxy, the plugin sees it that way. --- modules/plugin/base/src/nsPluginHostImpl.cpp | 10 ++++++++++ modules/plugin/nglsrc/nsPluginHostImpl.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp index 2b043f9098ac..e53c0ca7885a 100644 --- a/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -2067,6 +2067,7 @@ NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result) PRInt32 proxyPort = -1; PRBool useDirect = PR_FALSE; PRBool usePrefs = PR_TRUE; + PRInt32 proxyType = -1; NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &res); @@ -2115,6 +2116,15 @@ NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result) } } if (usePrefs) { + // first, see if the prefs say, use "direct connection to the + // internet". + // see bug http://bugzilla.mozilla.org/show_bug.cgi?id=48336 + res = prefs->GetIntPref("network.proxy.type", &proxyType); + if (NS_FAILED(res) || 0 == proxyType) { + useDirect = PR_TRUE; + } + } + if (usePrefs && !useDirect) { // If ProxyAutoConfig is not enabled, look to the prefs. // If the host for this url is in the "no proxy for" list, just go diff --git a/modules/plugin/nglsrc/nsPluginHostImpl.cpp b/modules/plugin/nglsrc/nsPluginHostImpl.cpp index 2b043f9098ac..e53c0ca7885a 100644 --- a/modules/plugin/nglsrc/nsPluginHostImpl.cpp +++ b/modules/plugin/nglsrc/nsPluginHostImpl.cpp @@ -2067,6 +2067,7 @@ NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result) PRInt32 proxyPort = -1; PRBool useDirect = PR_FALSE; PRBool usePrefs = PR_TRUE; + PRInt32 proxyType = -1; NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &res); @@ -2115,6 +2116,15 @@ NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result) } } if (usePrefs) { + // first, see if the prefs say, use "direct connection to the + // internet". + // see bug http://bugzilla.mozilla.org/show_bug.cgi?id=48336 + res = prefs->GetIntPref("network.proxy.type", &proxyType); + if (NS_FAILED(res) || 0 == proxyType) { + useDirect = PR_TRUE; + } + } + if (usePrefs && !useDirect) { // If ProxyAutoConfig is not enabled, look to the prefs. // If the host for this url is in the "no proxy for" list, just go