bug 1493619 - pad DNS entry grace period for low TTL cases r=dragana
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Oct 2018 07:18:50 +0000
changeset 496417 ddcd7cc2f3cdd88f5f399f4c59d530aceda0d722
parent 496416 ecb1a9d0a887ed363ab4e0199cea4a3e5787e0d3
child 496418 6c4930dac581c9d9acc581d66047d3a0d520e965
child 496445 8940f3ccdbd00b246dc41608545855580f675a90
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana
bugs1493619
milestone64.0a1
first release with
nightly linux32
ddcd7cc2f3cd / 64.0a1 / 20181011100123 / files
nightly linux64
ddcd7cc2f3cd / 64.0a1 / 20181011100123 / files
nightly mac
ddcd7cc2f3cd / 64.0a1 / 20181011100123 / files
nightly win32
ddcd7cc2f3cd / 64.0a1 / 20181011100123 / files
nightly win64
ddcd7cc2f3cd / 64.0a1 / 20181011100123 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1493619 - pad DNS entry grace period for low TTL cases r=dragana MozReview-Commit-ID: 8AsmyaSYVJr Differential Revision: https://phabricator.services.mozilla.com/D6793
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -233,16 +233,20 @@ nsHostRecord::CheckExpiration(const mozi
 
     return nsHostRecord::EXP_EXPIRED;
 }
 
 void
 nsHostRecord::SetExpiration(const mozilla::TimeStamp& now, unsigned int valid, unsigned int grace)
 {
     mValidStart = now;
+    if ((valid + grace) < 60) {
+        grace = 60 - valid;
+        LOG(("SetExpiration: artificially bumped grace to %d\n", grace));
+    }
     mGraceStart = now + TimeDuration::FromSeconds(valid);
     mValidEnd = now + TimeDuration::FromSeconds(valid + grace);
 }
 
 void
 nsHostRecord::CopyExpirationTimesAndFlagsFrom(const nsHostRecord *aFromHostRecord)
 {
     // This is used to copy information from a cache entry to a record. All