diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-03-07 21:42:15 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 13:04:05 +0200 |
commit | f3b148844a7fd337e528b21ea61b375b67d75b7a (patch) | |
tree | 32dd9b8d3d08b880892ddfb8d73bf1fef92d7de7 /netwerk | |
parent | 51d5d162b7614e09ae548726eb2197225559f395 (diff) | |
download | uxp-f3b148844a7fd337e528b21ea61b375b67d75b7a.tar.gz |
Issue #1474 - Prevent the cp detection from starting if preffed off.
When setting up connectivity, e.g. with new network detection, the pref
wouldn't be checked (or honored), resulting in spurious startup calls
despite being preffed off. This fixes that.
Resolves #1474
Diffstat (limited to 'netwerk')
-rw-r--r-- | netwerk/base/nsIOService.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp index bd9a4a96f4..314f2aeffd 100644 --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp @@ -79,6 +79,7 @@ namespace net { nsIOService* gIOService = nullptr; static bool gHasWarnedUploadChannel2; +static bool gCaptivePortalEnabled = false; static LazyLogModule gIOServiceLog("nsIOService"); #undef LOG #define LOG(args) MOZ_LOG(gIOServiceLog, LogLevel::Debug, args) @@ -1142,7 +1143,7 @@ nsIOService::SetConnectivityInternal(bool aConnectivity) mConnectivity = aConnectivity; if (mCaptivePortalService) { - if (aConnectivity && !xpc::AreNonLocalConnectionsDisabled()) { + if (aConnectivity && !xpc::AreNonLocalConnectionsDisabled() && gCaptivePortalEnabled) { // This will also trigger a captive portal check for the new network static_cast<CaptivePortalService*>(mCaptivePortalService.get())->Start(); } else { @@ -1285,10 +1286,9 @@ nsIOService::PrefsChanged(nsIPrefBranch *prefs, const char *pref) } if (!pref || strcmp(pref, NETWORK_CAPTIVE_PORTAL_PREF) == 0) { - bool captivePortalEnabled; - nsresult rv = prefs->GetBoolPref(NETWORK_CAPTIVE_PORTAL_PREF, &captivePortalEnabled); + nsresult rv = prefs->GetBoolPref(NETWORK_CAPTIVE_PORTAL_PREF, &gCaptivePortalEnabled); if (NS_SUCCEEDED(rv) && mCaptivePortalService) { - if (captivePortalEnabled && !xpc::AreNonLocalConnectionsDisabled()) { + if (gCaptivePortalEnabled && !xpc::AreNonLocalConnectionsDisabled()) { static_cast<CaptivePortalService*>(mCaptivePortalService.get())->Start(); } else { static_cast<CaptivePortalService*>(mCaptivePortalService.get())->Stop(); |