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



The followings patches resolve the following bug (not in bugzilla):

Just maka one NS query, not two, when a user is trying to do some
task, such as ping, traceroute, scan.  Also, lookup (a NS tool)
is not suppossed to use gethostbyname, because the tool must to
resolve a hostname.  The perfomance is a bit better, specially
for users that only has a modem line.

This patch, also allow to lookup for TLD's or any other domain
that only has NS resource records, for instance, .net, .org,
.golder.org, etc.

-- 
Germán Poó Caamaño
http://www.ubiobio.cl/~gpoo/
Index: src/callbacks.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/callbacks.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- src/callbacks.c	10 Sep 2004 03:26:30 -0000	1.14
+++ src/callbacks.c	10 Sep 2004 04:26:12 -0000	1.15
@@ -191,7 +191,7 @@
 	if (lookup->running) {
 		lookup_stop (lookup);
 	} else {
-		if (netinfo_validate_host (lookup)) {
+		if (netinfo_validate_domain (lookup)) {
 			entry_host = GTK_ENTRY (
 				gtk_bin_get_child (GTK_BIN (lookup->host)));
 			text = g_strdup (gtk_entry_get_text (entry_host));
Index: src/lookup.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/lookup.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- src/lookup.c	5 Jul 2004 16:51:29 -0000	1.4
+++ src/lookup.c	10 Sep 2004 04:26:12 -0000	1.5
@@ -78,7 +78,7 @@
 		g_free (netinfo->stbar_text);
 	netinfo->stbar_text = g_strdup_printf (_("Looking up %s"), host);
 
-	if (netinfo_validate_host (netinfo) == FALSE) {
+	if (netinfo_validate_domain (netinfo) == FALSE) {
 		netinfo_stop_process_command (netinfo);
 		return;
 	}
Index: src/ping.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/ping.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- src/ping.c	5 Jul 2004 16:51:29 -0000	1.4
+++ src/ping.c	10 Sep 2004 04:26:12 -0000	1.5
@@ -60,7 +60,10 @@
 
 	g_return_if_fail (netinfo != NULL);
 
-	if (netinfo_validate_host (netinfo) == FALSE) {
+	/* Because of the delay, we can't check twice for a hostname/IP.
+	 * It was made before this function was called.  Anyway, we
+	 * check at least if we have a text as hostname */
+	if (netinfo_validate_domain (netinfo) == FALSE) {
 		netinfo_stop_process_command (netinfo);
 		return;
 	}
Index: src/scan.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/scan.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- src/scan.c	5 Jul 2004 16:51:29 -0000	1.3
+++ src/scan.c	10 Sep 2004 04:26:12 -0000	1.4
@@ -68,7 +68,10 @@
 
 	g_return_if_fail (netinfo != NULL);
 
-	if (netinfo_validate_host (netinfo) == FALSE) {
+	/* Because of the delay, we can't check twice for a hostname/IP.
+	 * It was made before this function was called.  Anyway, we
+	 * check at least if we have a text as hostname */
+	if (netinfo_validate_domain (netinfo) == FALSE) {
 		netinfo_stop_process_command (netinfo);
 		return;
 	}
Index: src/traceroute.c
===================================================================
RCS file: /cvs/gnome/gnome-nettool/src/traceroute.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- src/traceroute.c	5 Jul 2004 16:51:29 -0000	1.4
+++ src/traceroute.c	10 Sep 2004 04:26:12 -0000	1.5
@@ -46,7 +46,10 @@
         
 	g_return_if_fail (netinfo != NULL);
 
-	if (netinfo_validate_host (netinfo) == FALSE) {
+	/* Because of the delay, we can't check twice for a hostname/IP.
+	 * It was made before this function was called.  Anyway, we
+	 * check at least if we have a text as hostname */
+	if (netinfo_validate_domain (netinfo) == FALSE) {
 		netinfo_stop_process_command (netinfo);
 		return;
 	}


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