Index: libgnomevfs/gnome-vfs-dns-sd.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-dns-sd.c,v
retrieving revision 1.19
diff -u -r1.19 gnome-vfs-dns-sd.c
--- libgnomevfs/gnome-vfs-dns-sd.c	27 Feb 2006 10:32:22 -0000	1.19
+++ libgnomevfs/gnome-vfs-dns-sd.c	27 Feb 2006 21:54:08 -0000
@@ -1324,7 +1324,8 @@
 	GHashTable *hash;
 	size_t text_len;
 	char *text;
-	char host[128];
+	const char *host;
+	char a[128];
 
 	handle = user_data;
 	if (event == AVAHI_RESOLVER_FOUND) {
@@ -1337,8 +1338,15 @@
 		service.name = (char *)name;
 		service.type = (char *)type;
 		service.domain = (char *)domain;
+
+		if (address) {
+			avahi_address_snprint (a, sizeof(a), address);
+			host = a;
+		} else {
+			g_assert (NULL != host_name);
+			host = host_name;
+		}
 		
-		avahi_address_snprint (host, sizeof(host), address);
 		handle->callback (handle,
 				  GNOME_VFS_OK,
 				  &service,
@@ -1532,7 +1540,8 @@
 		if (client) {
 			sr = avahi_service_resolver_new (client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 
 							 name, type, domain, AVAHI_PROTO_UNSPEC, 
-							 0, avahi_resolve_async_callback, handle);
+							 AVAHI_LOOKUP_NO_ADDRESS,
+							 avahi_resolve_async_callback, handle);
 			if (sr != NULL) {
 				handle->avahi_sr = sr;
 				*handle_out = handle;
@@ -1998,8 +2007,15 @@
 	data = user_data;
 	if (event == AVAHI_RESOLVER_FOUND) {
 		data->got_data = TRUE;
-		avahi_address_snprint (a, sizeof(a), address);
-		data->host = g_strdup (a);
+
+		if (address) {
+			avahi_address_snprint (a, sizeof(a), address);
+			data->host = g_strdup (a);
+		} else {
+			g_assert (NULL != host_name);
+			data->host = g_strdup (host_name);
+		}
+
 		data->port = port;
 		data->text_len = avahi_string_list_serialize (txt, NULL, 0);
 		data->text = g_malloc (data->text_len);
@@ -2111,7 +2127,8 @@
 		
 		sr = avahi_service_resolver_new (client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 
 						 name, type, domain, AVAHI_PROTO_UNSPEC, 
-						 0, avahi_resolve_sync_callback, &resolve_data);
+						 AVAHI_LOOKUP_NO_ADDRESS,
+						 avahi_resolve_sync_callback, &resolve_data);
 		if (sr == NULL) {
 			g_warning ("Failed to resolve service '%s': %s\n", name, avahi_strerror (avahi_client_errno (client)));
 			avahi_client_free (client);
