Bug 1688806 - Reset TRRService confirmation retry interval and cancel an ongoing retry timer when captive-portal-connectivity is observed. r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D103005
This commit is contained in:
Nihanth Subramanya 2021-01-29 15:13:49 +00:00
Родитель 009b517f40
Коммит 95c3dc2f49
1 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -566,17 +566,19 @@ TRRService::Observe(nsISupports* aSubject, const char* aTopic,
// unless the service is in a TRR=enabled mode.
if (mMode == nsIDNSService::MODE_TRRFIRST ||
mMode == nsIDNSService::MODE_TRRONLY) {
if (!mCaptiveIsPassed) {
if (mConfirmationState != CONFIRM_OK) {
mConfirmationState = CONFIRM_TRYING;
MaybeConfirm();
}
} else {
LOG(("TRRservice CP clear when already up!\n"));
if (mRetryConfirmTimer) {
mRetryConfirmTimer->Cancel();
mRetryConfirmTimer = nullptr;
}
mRetryConfirmInterval = StaticPrefs::network_trr_retry_timeout_ms();
if (mConfirmationState != CONFIRM_OK) {
mConfirmationState = CONFIRM_TRYING;
MaybeConfirm();
}
mCaptiveIsPassed = true;
}
mCaptiveIsPassed = true;
} else if (!strcmp(aTopic, kClearPrivateData) || !strcmp(aTopic, kPurge)) {
// flush the TRR blocklist
auto bl = mTRRBLStorage.Lock();