bug 1454941 - revert CP wait fix from bug 1451150 r=valentin
authorDaniel Stenberg <daniel@haxx.se>
Wed, 18 Apr 2018 15:21:14 +0200
changeset 467825 fb3d15010d656629f19e40b5964b294dedaf67f5
parent 467824 b5f89882b96623f6458ffeb2f97ef3a59f716a46
child 467826 963466173a7466f7a5fe51d2b405ebbbc57e8bfd
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1454941, 1451150
milestone61.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 1454941 - revert CP wait fix from bug 1451150 r=valentin ... but keep the logic that avoids re-initialization. MozReview-Commit-ID: 2XQCRaM6U4B
netwerk/dns/TRRService.cpp
--- a/netwerk/dns/TRRService.cpp
+++ b/netwerk/dns/TRRService.cpp
@@ -281,41 +281,41 @@ TRRService::Observe(nsISupports *aSubjec
 
   } else if (!strcmp(aTopic, kOpenCaptivePortalLoginEvent)) {
     // We are in a captive portal
     LOG(("TRRservice in captive portal\n"));
     mCaptiveIsPassed = false;
   } else if (!strcmp(aTopic, NS_CAPTIVE_PORTAL_CONNECTIVITY)) {
     nsAutoCString data = NS_ConvertUTF16toUTF8(aData);
     LOG(("TRRservice captive portal was %s\n", data.get()));
-    if (data.Equals("clear")) {
-      if (!mTRRBLStorage) {
-        mTRRBLStorage = DataStorage::Get(DataStorageClass::TRRBlacklist);
-        if (mTRRBLStorage) {
-          bool storageWillPersist = true;
-          if (NS_FAILED(mTRRBLStorage->Init(storageWillPersist))) {
-            mTRRBLStorage = nullptr;
+    if (!mTRRBLStorage) {
+      mTRRBLStorage = DataStorage::Get(DataStorageClass::TRRBlacklist);
+      if (mTRRBLStorage) {
+        bool storageWillPersist = true;
+        if (NS_FAILED(mTRRBLStorage->Init(storageWillPersist))) {
+          mTRRBLStorage = nullptr;
+        }
+        if (mClearTRRBLStorage) {
+          if (mTRRBLStorage) {
+            mTRRBLStorage->Clear();
           }
-          if (mClearTRRBLStorage) {
-            if (mTRRBLStorage) {
-              mTRRBLStorage->Clear();
-            }
-            mClearTRRBLStorage = false;
-          }
+          mClearTRRBLStorage = false;
         }
       }
-      if (mConfirmationState != CONFIRM_OK) {
-        mConfirmationState = CONFIRM_TRYING;
-        MaybeConfirm();
-      } else {
-        LOG(("TRRservice CP clear when already up!\n"));
-      }
-      mCaptiveIsPassed = true;
     }
 
+    if (mConfirmationState != CONFIRM_OK) {
+      mConfirmationState = CONFIRM_TRYING;
+      MaybeConfirm();
+    } else {
+      LOG(("TRRservice CP clear when already up!\n"));
+    }
+
+    mCaptiveIsPassed = true;
+
   } else if (!strcmp(aTopic, kClearPrivateData) ||
              !strcmp(aTopic, kPurge)) {
     // flush the TRR blacklist, both in-memory and on-disk
     if (mTRRBLStorage) {
       mTRRBLStorage->Clear();
     }
   }
   return NS_OK;