bug 1457005 - TRR: reset confirmation state machine on prefs update r=mcmanus
authorDaniel Stenberg <daniel@haxx.se>
Thu, 26 Apr 2018 00:07:31 +0200
changeset 460882 1936e3c9b600639a9e5ce6e5df93f64607d2ddaf
parent 460881 d8bb9fa651c6484a07d441109553d80403493aef
child 460883 dd262c337f19cc60d458d24760637c9fe2d34a2e
push id165
push userfmarier@mozilla.com
push dateMon, 30 Apr 2018 23:50:51 +0000
reviewersmcmanus
bugs1457005
milestone61.0a1
bug 1457005 - TRR: reset confirmation state machine on prefs update r=mcmanus If the confirmation state machine has gone into FAILED mode, updated prefs is reason enough to try again and possibly get TRR verified proper. MozReview-Commit-ID: ALRbNJdvxdn
netwerk/dns/TRRService.cpp
--- a/netwerk/dns/TRRService.cpp
+++ b/netwerk/dns/TRRService.cpp
@@ -267,19 +267,20 @@ TRRService::Observe(nsISupports *aSubjec
                     const char * aTopic,
                     const char16_t * aData)
 {
   MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
   LOG(("TRR::Observe() topic=%s\n", aTopic));
   if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
     ReadPrefs(NS_ConvertUTF16toUTF8(aData).get());
 
-    if ((mConfirmationState == CONFIRM_INIT) &&
-        !mBootstrapAddr.IsEmpty() &&
-        (mMode == MODE_TRRONLY)) {
+    if (((mConfirmationState == CONFIRM_INIT) &&
+         !mBootstrapAddr.IsEmpty() &&
+         (mMode == MODE_TRRONLY))  ||
+        (mConfirmationState == CONFIRM_FAILED)) {
       mConfirmationState = CONFIRM_TRYING;
       MaybeConfirm();
     }
 
   } else if (!strcmp(aTopic, kOpenCaptivePortalLoginEvent)) {
     // We are in a captive portal
     LOG(("TRRservice in captive portal\n"));
     mCaptiveIsPassed = false;