[glibmm] This test assumes that the first DNS result it gets for www.google.com is an IPv4 address -- but it



commit dad1b7d8847582114f819e2f1bfd746934a5511f
Author: Adam Sampson <ats-gnomebugs offog org>
Date:   Sun Dec 8 19:51:10 2013 +0100

    This test assumes that the first DNS result it gets for www.google.com is an
    IPv4 address -- but it can equally well be an IPv6 address. Create the right
    kind of socket to match.

 tests/giomm_tls_client/main.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc
index 8752970..c76551a 100644
--- a/tests/giomm_tls_client/main.cc
+++ b/tests/giomm_tls_client/main.cc
@@ -80,8 +80,8 @@ int main(int, char**)
     first_inet_address->to_string() << "." << std::endl;
 
   Glib::RefPtr<Gio::Socket> socket =
-    Gio::Socket::create(Gio::SOCKET_FAMILY_IPV4, Gio::SOCKET_TYPE_STREAM,
-    Gio::SOCKET_PROTOCOL_TCP);
+    Gio::Socket::create(first_inet_address->get_family(),
+    Gio::SOCKET_TYPE_STREAM, Gio::SOCKET_PROTOCOL_TCP);
 
   Glib::RefPtr<Gio::InetSocketAddress> address =
     Gio::InetSocketAddress::create(first_inet_address, 443);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]