From bb14e0a8aa3173c8a6d80b1a9c8b300a452ee9f1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 12 Oct 2005 02:37:08 +0000 Subject: * 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 --- avahi-discover-standalone/main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'avahi-discover-standalone') 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 #include + #include #include + #include #include +#include + #include #include @@ -312,13 +316,11 @@ static void service_resolver_callback( return; } - if (event == AVAHI_RESOLVER_TIMEOUT) - gtk_label_set_markup(info_label, "Failed to resolve: Timeout."); - else if (event == AVAHI_RESOLVER_FAILURE) - gtk_label_set_markup(info_label, "Failed to resolve: Failure."); - else if (event == AVAHI_RESOLVER_NOT_FOUND) - gtk_label_set_markup(info_label, "Failed to resolve: Not found."); - else if (event == AVAHI_RESOLVER_FOUND) + if (event == AVAHI_RESOLVER_FAILURE) { + char t[256]; + snprintf(t, sizeof(t), "Failed to resolve: %s.", 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); } -- cgit