Bug 825492: Fix IPv6 DNS lookups on Windows. r=sworkman
authorJosh Aas <joshmoz@gmail.com>
Wed, 02 Jan 2013 17:40:18 -0500
changeset 126497 dcadc9aabc43ab40658e872f9a6db06ec87d4eed
parent 126496 26b70250e6fea4283932678039a01f192db18c16
child 126498 c42fa8f9377e693b8caa35b68df89d2dc8bbcf9b
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssworkman
bugs825492
milestone20.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 825492: Fix IPv6 DNS lookups on Windows. r=sworkman
netwerk/dns/DNS.h
--- a/netwerk/dns/DNS.h
+++ b/netwerk/dns/DNS.h
@@ -42,19 +42,28 @@
    ((a)->u32[1] == 0)  &&          \
    ((a)->u32[2] == 0)  &&          \
    ((a)->u32[3] == 0))
 
 namespace mozilla {
 namespace net {
 
 // Required buffer size for text form of an IP address.
-// Includes space for null termination.
+// Includes space for null termination. We make our own contants
+// because we don't want higher-level code depending on things
+// like INET6_ADDRSTRLEN and having to include the associated
+// platform-specific headers.
+#ifdef XP_WIN
+// Windows requires longer buffers for some reason.
+const int kIPv4CStrBufSize = 22;
+const int kIPv6CStrBufSize = 65;
+#else
 const int kIPv4CStrBufSize = 16;
 const int kIPv6CStrBufSize = 46;
+#endif
 
 // This was all created at a time in which we were using NSPR for host
 // resolution and we were propagating NSPR types like "PRAddrInfo" and
 // "PRNetAddr" all over Gecko. This made it hard to use another host
 // resolver -- we were locked into NSPR. The goal here is to get away
 // from that. We'll translate what we get from NSPR or any other host
 // resolution library into the types below and use them in Gecko.