Bug 1743022 - Only call AddToBlocklist once r=necko-reviewers,kershaw

On windows getaddrinfo does not return TTL info for the DNS record. so we do a
second DNS resolution that uses DNSQueryA to get the TTL. We should only call
AddToBlocklist after the first DNS resolution completes. Doing so again for
the DNSQueryA refresh is unnecessary and possibly extends the lifetime of the
blocklist past the 60s that is default.

This patch also reenables the blocklist when TRR strict mode is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D136715
This commit is contained in:
Valentin Gosu 2022-01-25 15:57:04 +00:00
Родитель 0337a7de38
Коммит 5ca35924eb
1 изменённых файлов: 2 добавлений и 3 удалений

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

@ -412,9 +412,8 @@ void AddrHostRecord::ResolveComplete() {
break;
}
if (mResolverType == DNSResolverType::TRR &&
!StaticPrefs::network_trr_strict_native_fallback() && !mTRRSuccess &&
mNativeSuccess && TRRService::Get()) {
if (mResolverType == DNSResolverType::TRR && !mTRRSuccess && mNativeSuccess &&
!LoadGetTtl() && TRRService::Get()) {
TRRService::Get()->AddToBlocklist(nsCString(host), originSuffix, pb, true);
}
}