diff --git a/netwerk/dns/TRR.cpp b/netwerk/dns/TRR.cpp index 91ebd541f145..37e4ad84880c 100644 --- a/netwerk/dns/TRR.cpp +++ b/netwerk/dns/TRR.cpp @@ -46,6 +46,7 @@ NS_IMETHODIMP TRR::Notify(nsITimer *aTimer) { if (aTimer == mTimeout) { + LOG(("TRR request for %s timed out\n", mHost.get())); mTimeout = nullptr; Cancel(); } else { diff --git a/netwerk/dns/TRRService.cpp b/netwerk/dns/TRRService.cpp index 3d8519275026..092b00c99adb 100644 --- a/netwerk/dns/TRRService.cpp +++ b/netwerk/dns/TRRService.cpp @@ -44,7 +44,6 @@ TRRService::TRRService() , mUseGET(false) , mClearTRRBLStorage(false) , mConfirmationState(CONFIRM_INIT) - , mRetryConfirmInterval(1000) { MOZ_ASSERT(NS_IsMainThread(), "wrong thread"); } @@ -84,19 +83,13 @@ bool TRRService::Enabled() { if (mConfirmationState == CONFIRM_INIT && !mWaitForCaptive) { - LOG(("TRRService::Enabled => CONFIRM_TRYING\n")); mConfirmationState = CONFIRM_TRYING; } if (mConfirmationState == CONFIRM_TRYING) { - LOG(("TRRService::Enabled MaybeConfirm()\n")); MaybeConfirm(); } - if (mConfirmationState != CONFIRM_OK) { - LOG(("TRRService::Enabled mConfirmationState=%d\n", (int)mConfirmationState)); - } - return (mConfirmationState == CONFIRM_OK); } @@ -297,8 +290,6 @@ TRRService::MaybeConfirm() { if ((mMode == MODE_NATIVEONLY) || mConfirmer || mConfirmationState != CONFIRM_TRYING) { - LOG(("TRRService:MaybeConfirm mode=%d, mConfirmer=%p mConfirmationState=%d\n", - (int)mMode, mConfirmer, (int)mConfirmationState)); return; } nsAutoCString host; @@ -487,24 +478,6 @@ TRRService::TRRBlacklist(const nsACString &aHost, bool privateBrowsing, bool aPa } } -NS_IMETHODIMP -TRRService::Notify(nsITimer *aTimer) -{ - if (aTimer == mRetryConfirmTimer) { - mRetryConfirmTimer = nullptr; - if (mConfirmationState == CONFIRM_FAILED) { - LOG(("TRRService retry NS of %s\n", mConfirmationNS.get())); - mConfirmationState = CONFIRM_TRYING; - MaybeConfirm(); - } - } else { - MOZ_CRASH("Unknown timer"); - } - - return NS_OK; -} - - AHostResolver::LookupStatus TRRService::CompleteLookup(nsHostRecord *rec, nsresult status, AddrInfo *aNewRRSet, bool pb) { @@ -523,18 +496,6 @@ TRRService::CompleteLookup(nsHostRecord *rec, nsresult status, AddrInfo *aNewRRS LOG(("TRRService finishing confirmation test %s %d %X\n", mPrivateURI.get(), (int)mConfirmationState, (unsigned int)status)); mConfirmer = nullptr; - if ((mConfirmationState == CONFIRM_FAILED) && (mMode == MODE_TRRONLY)) { - // in TRR-only mode; retry failed confirmations - NS_NewTimerWithCallback(getter_AddRefs(mRetryConfirmTimer), - this, mRetryConfirmInterval, - nsITimer::TYPE_ONE_SHOT); - if (mRetryConfirmInterval < 64000) { - // double the interval up to this point - mRetryConfirmInterval *= 2; - } - } else { - mRetryConfirmInterval = 1000; - } return LOOKUP_OK; } diff --git a/netwerk/dns/TRRService.h b/netwerk/dns/TRRService.h index 1a0d82d15681..0003fc9c0b53 100644 --- a/netwerk/dns/TRRService.h +++ b/netwerk/dns/TRRService.h @@ -19,14 +19,12 @@ namespace net { class TRRService : public nsIObserver - , public nsITimerCallback , public nsSupportsWeakReference , public AHostResolver { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOBSERVER - NS_DECL_NSITIMERCALLBACK TRRService(); nsresult Init(); @@ -81,9 +79,7 @@ private: CONFIRM_FAILED = 3 }; Atomic mConfirmationState; - RefPtr mConfirmer; - nsCOMPtr mRetryConfirmTimer; - uint32_t mRetryConfirmInterval; // milliseconds until retry + RefPtr mConfirmer; }; extern TRRService *gTRRService;