Bug 1460330 - Always use use TTL with TRR. r=mcmanus
authorDaniel Stenberg <daniel@haxx.se>
Thu, 10 May 2018 06:32:00 -0400
changeset 471976 ce7a39303eff573c740268bcb9dacd013c9c02f4
parent 471975 9d23e0279ecde11c1ffefd82e1d1f8c4d3d8adb8
child 471977 b6f2b443c040c9955682fac387876fff75f3e9d2
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1460330
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1460330 - Always use use TTL with TRR. r=mcmanus
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -1396,17 +1396,17 @@ nsHostResolver::PrepareRecordExpiration(
              NEGATIVE_RECORD_LIFETIME));
         return;
     }
 
     unsigned int lifetime = mDefaultCacheLifetime;
     unsigned int grace = mDefaultGracePeriod;
 
     unsigned int ttl = mDefaultCacheLifetime;
-    if (sGetTtlEnabled) {
+    if (sGetTtlEnabled || 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;
     }
 
     rec->SetExpiration(TimeStamp::NowLoRes(), lifetime, grace);