diff options
Diffstat (limited to 'net/base/host_resolver_proc.cc')
-rw-r--r-- | net/base/host_resolver_proc.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc index 5ccf01a..d4e0766 100644 --- a/net/base/host_resolver_proc.cc +++ b/net/base/host_resolver_proc.cc @@ -227,4 +227,27 @@ int SystemHostResolverProc(const std::string& host, return OK; } +// TODO(jar): The following is a simple estimate of ipv6 support. We may need +// to do a test resolution, and a test connection, to REALLY verify support. +// static +bool HostResolverProc::IPv6Supported() { +#if defined(OS_POSIX) + int test_socket; +#else + SOCKET test_socket; +#endif + + test_socket = socket(AF_INET6, SOCK_STREAM, 0); + if (test_socket == -1) + return false; + +#if defined(OS_POSIX) + close(test_socket); +#else + closesocket(test_socket); +#endif + + return true; +} + } // namespace net |