Bug 1416048 - Use uint32_t for DNS TTL data. r=valentin
authorDaniel Stenberg <daniel@haxx.se>
Thu, 09 Nov 2017 15:43:00 -0500
changeset 391207 e118b79b153ec2423fc5d455fb50ac6a04375685
parent 391206 8411c490c109ecb8eb0e077c896988041913035c
child 391208 43cf3f8f1fd6808a500c4e47e43a0fb939685de2
push id97221
push userryanvm@gmail.com
push dateFri, 10 Nov 2017 16:04:46 +0000
treeherdermozilla-inbound@e118b79b153e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1416048
milestone58.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 1416048 - Use uint32_t for DNS TTL data. r=valentin
netwerk/dns/DNS.h
netwerk/dns/GetAddrInfo.cpp
--- a/netwerk/dns/DNS.h
+++ b/netwerk/dns/DNS.h
@@ -143,18 +143,18 @@ public:
   ~AddrInfo();
 
   void AddAddress(NetAddrElement *address);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
 
   char *mHostName;
   char *mCanonicalName;
-  uint16_t ttl;
-  static const uint16_t NO_TTL_DATA = (uint16_t) -1;
+  uint32_t ttl;
+  static const uint32_t NO_TTL_DATA = (uint32_t) -1;
 
   LinkedList<NetAddrElement> mAddresses;
 
 private:
   void Init(const char *host, const char *cname);
 };
 
 // Copies the contents of a PRNetAddr to a NetAddr.
--- a/netwerk/dns/GetAddrInfo.cpp
+++ b/netwerk/dns/GetAddrInfo.cpp
@@ -191,17 +191,17 @@ static MOZ_ALWAYS_INLINE nsresult
     }
   }
 
   dnsapi->mDnsFreeFunc(dnsData, DNS_FREE_TYPE::DnsFreeRecordList);
   return NS_OK;
 }
 
 static MOZ_ALWAYS_INLINE nsresult
-_GetTTLData_Windows(const char* aHost, uint16_t* aResult, uint16_t aAddressFamily)
+_GetTTLData_Windows(const char* aHost, uint32_t* aResult, uint16_t aAddressFamily)
 {
   MOZ_ASSERT(aHost);
   MOZ_ASSERT(aResult);
   if (aAddressFamily != PR_AF_UNSPEC &&
       aAddressFamily != PR_AF_INET &&
       aAddressFamily != PR_AF_INET6) {
     return NS_ERROR_UNEXPECTED;
   }
@@ -346,17 +346,17 @@ GetAddrInfo(const char* aHost, uint16_t 
     const char *name = nullptr;
     if (*aAddrInfo != nullptr && (*aAddrInfo)->mCanonicalName) {
       name = (*aAddrInfo)->mCanonicalName;
     } else {
       name = aHost;
     }
 
     LOG("Getting TTL for %s (cname = %s).", aHost, name);
-    uint16_t ttl = 0;
+    uint32_t ttl = 0;
     nsresult ttlRv = _GetTTLData_Windows(name, &ttl, aAddressFamily);
     if (NS_SUCCEEDED(ttlRv)) {
       (*aAddrInfo)->ttl = ttl;
       LOG("Got TTL %u for %s (name = %s).", ttl, aHost, name);
     } else {
       LOG_WARNING("Could not get TTL for %s (cname = %s).", aHost, name);
     }
   }