Bug 1177909 - Part 1: support perferred proxy type while using system proxy setting; r=bagder
authorLiang-Heng Chen <xeonchen@gmail.com>
Mon, 12 Jun 2017 11:41:14 +0800
changeset 365119 4a954e387736017e31edf9165b9c99976e84f128
parent 365118 bed4f1657a9fe81a0f0d2c70c17d9625d979b0a0
child 365120 004b0a044f7b5bebc2597285f32d159533b4cc8d
push id32061
push usercbook@mozilla.com
push dateWed, 21 Jun 2017 12:54:35 +0000
treeherdermozilla-central@2b07ef4f3381 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder
bugs1177909
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1177909 - Part 1: support perferred proxy type while using system proxy setting; r=bagder MozReview-Commit-ID: 7C5pSxO1d2j
netwerk/base/nsProtocolProxyService.cpp
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -1975,16 +1975,24 @@ nsProtocolProxyService::Resolve_Internal
         nsAutoCString scheme;
         int32_t port = -1;
 
         uri->GetAsciiSpec(spec);
         uri->GetAsciiHost(host);
         uri->GetScheme(scheme);
         uri->GetPort(&port);
 
+        if (flags & RESOLVE_PREFER_SOCKS_PROXY) {
+            LOG(("Ignoring RESOLVE_PREFER_SOCKS_PROXY for system proxy setting\n"));
+        } else if (flags & RESOLVE_PREFER_HTTPS_PROXY) {
+            scheme.AssignLiteral("https");
+        } else if (flags & RESOLVE_IGNORE_URI_SCHEME) {
+            scheme.AssignLiteral("http");
+        }
+
         // now try the system proxy settings for this particular url
         if (NS_SUCCEEDED(mSystemProxySettings->
                          GetProxyForURI(spec, scheme, host, port,
                                         pacString))) {
             ProcessPACString(pacString, 0, result);
             return NS_OK;
         }
     }