Bug 1947414 - grace period is now actually applied r=necko-reviewers,valentin
We set `grace=0` before for requests that had a TTL. Now that we want to experiment with bigger grace periods we don't zero the grace period at all anymore, no matter if there is a TTL or not. Also cleaned up the (now unnessecary) nested if condition and removed double allocation of TTL data. Differential Revision: https://phabricator.services.mozilla.com/D238033
This commit is contained in:
@@ -1318,13 +1318,8 @@ void nsHostResolver::PrepareRecordExpirationAddrRecord(
|
||||
unsigned int lifetime = StaticPrefs::network_dnsCacheExpiration();
|
||||
unsigned int grace = StaticPrefs::network_dnsCacheExpirationGracePeriod();
|
||||
|
||||
unsigned int ttl = StaticPrefs::network_dnsCacheExpiration();
|
||||
if (StaticPrefs::network_dns_get_ttl() || rec->addr_info->IsTRR()) {
|
||||
if (rec->addr_info && rec->addr_info->TTL() != AddrInfo::NO_TTL_DATA) {
|
||||
ttl = rec->addr_info->TTL();
|
||||
}
|
||||
lifetime = ttl;
|
||||
grace = 0;
|
||||
lifetime = rec->addr_info->TTL();
|
||||
}
|
||||
|
||||
rec->SetExpiration(TimeStamp::NowLoRes(), lifetime, grace);
|
||||
|
||||
Reference in New Issue
Block a user