[gnome-network] Request for gnome-nettool freeze break (3)



The following little patch increase the usability (perfomance) for
users with slow links.

It try to resolve a hostname as IPv4 address first, instead IPv6.
This the common case.  If it try to resolve an IPv6 address at
first, it almost always will do two nameservers querys.

-- 
Germán Poó Caamaño
http://www.ubiobio.cl/~gpoo/
Index: src/nettool.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/nettool.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- src/nettool.c	5 Jul 2004 16:51:29 -0000	1.7
+++ src/nettool.c	10 Sep 2004 04:26:12 -0000	1.8
@@ -191,6 +191,7 @@
 
 	gtk_dialog_run (GTK_DIALOG (dialog));
 	gtk_widget_destroy (dialog);
+	g_free (message);
 }
 
 gboolean
@@ -207,9 +208,9 @@
 		secondary = g_strdup (_("Please enter a valid network address and try again."));
 	}
 	else {
-		hostname = gethostbyname2 (host, PF_INET6);
+		hostname = gethostbyname2 (host, PF_INET);
 		if (hostname == NULL) {
-			hostname = gethostbyname2 (host, AF_INET);
+			hostname = gethostbyname2 (host, PF_INET6);
 			if (hostname == NULL) {
 				primary = g_strdup_printf (_("The address '%s' cannot be found"),
 							   host);


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