summaryrefslogtreecommitdiffstats
path: root/avahi-discover-standalone
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-10-12 02:37:08 +0000
committerLennart Poettering <lennart@poettering.net>2005-10-12 02:37:08 +0000
commitbb14e0a8aa3173c8a6d80b1a9c8b300a452ee9f1 (patch)
treed29ec90346b7523aa877207ae29e461b767460c6 /avahi-discover-standalone
parent7484feb19b10878042dcb8cea618d10df5440c1c (diff)
* drop AVAHI_RESOLVER_TIMEOUT, AVAHI_RESOLVER_NOT_FOUND and AVAHI_BROWSER_NOT_FOUND, use AVAHI_xxx_FAILURE instead
* set the client/server errno variable when AVAHI_xxx_FAILURE happens * update DBUS interface accordingly, pass errno value with Failure events * Pass DNS return codes to the app by wrapping them in avahi error codes git-svn-id: file:///home/lennart/svn/public/avahi/trunk@732 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-discover-standalone')
-rw-r--r--avahi-discover-standalone/main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/avahi-discover-standalone/main.c b/avahi-discover-standalone/main.c
index c6e9cc4..296b56d 100644
--- a/avahi-discover-standalone/main.c
+++ b/avahi-discover-standalone/main.c
@@ -30,10 +30,14 @@
#include <gtk/gtk.h>
#include <glade/glade.h>
+
#include <avahi-core/core.h>
#include <avahi-core/lookup.h>
+
#include <avahi-common/strlst.h>
#include <avahi-common/domain.h>
+#include <avahi-common/error.h>
+
#include <avahi-glib/glib-watch.h>
#include <avahi-glib/glib-malloc.h>
@@ -312,13 +316,11 @@ static void service_resolver_callback(
return;
}
- if (event == AVAHI_RESOLVER_TIMEOUT)
- gtk_label_set_markup(info_label, "<i>Failed to resolve: Timeout.</i>");
- else if (event == AVAHI_RESOLVER_FAILURE)
- gtk_label_set_markup(info_label, "<i>Failed to resolve: Failure.</i>");
- else if (event == AVAHI_RESOLVER_NOT_FOUND)
- gtk_label_set_markup(info_label, "<i>Failed to resolve: Not found.</i>");
- else if (event == AVAHI_RESOLVER_FOUND)
+ if (event == AVAHI_RESOLVER_FAILURE) {
+ char t[256];
+ snprintf(t, sizeof(t), "<i>Failed to resolve: %s.</i>", avahi_strerror(avahi_server_errno(server)));
+ gtk_label_set_markup(info_label, t);
+ } else if (event == AVAHI_RESOLVER_FOUND)
update_label(s, host_name, a, port, txt);
}