summaryrefslogtreecommitdiffstats
path: root/avahi-daemon/simple-protocol.c
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-daemon/simple-protocol.c
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-daemon/simple-protocol.c')
-rw-r--r--avahi-daemon/simple-protocol.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c
index 0c9989a..d53987d 100644
--- a/avahi-daemon/simple-protocol.c
+++ b/avahi-daemon/simple-protocol.c
@@ -178,12 +178,8 @@ static void host_name_resolver_callback(
assert(c);
- if (event == AVAHI_RESOLVER_TIMEOUT)
- client_output_printf(c, "%+i Query timed out\n", AVAHI_ERR_TIMEOUT);
- else if (event == AVAHI_RESOLVER_FAILURE)
- client_output_printf(c, "%+i Query failed\n", AVAHI_ERR_FAILURE);
- else if (event == AVAHI_RESOLVER_NOT_FOUND)
- client_output_printf(c, "%+i Query timed out\n", AVAHI_ERR_NOT_FOUND);
+ if (event == AVAHI_RESOLVER_FAILURE)
+ client_output_printf(c, "%+i %s\n", avahi_server_errno(avahi_server), avahi_strerror(avahi_server_errno(avahi_server)));
else if (event == AVAHI_RESOLVER_FOUND) {
char t[64];
avahi_address_snprint(t, sizeof(t), a);
@@ -207,12 +203,8 @@ static void address_resolver_callback(
assert(c);
- if (event == AVAHI_RESOLVER_TIMEOUT)
- client_output_printf(c, "%+i Query timed out\n", AVAHI_ERR_TIMEOUT);
- else if (event == AVAHI_RESOLVER_FAILURE)
- client_output_printf(c, "%+i Query failed\n", AVAHI_ERR_FAILURE);
- else if (event == AVAHI_RESOLVER_NOT_FOUND)
- client_output_printf(c, "%+i Not found\n", AVAHI_ERR_NOT_FOUND);
+ if (event == AVAHI_RESOLVER_FAILURE)
+ client_output_printf(c, "%+i %s\n", avahi_server_errno(avahi_server), avahi_strerror(avahi_server_errno(avahi_server)));
else if (event == AVAHI_RESOLVER_FOUND)
client_output_printf(c, "+ %i %u %s\n", iface, protocol, hostname);
@@ -240,12 +232,7 @@ static void dns_server_browser_callback(
switch (event) {
case AVAHI_BROWSER_FAILURE:
- client_output_printf(c, "%+i Query failed\n", AVAHI_ERR_FAILURE);
- c->state = CLIENT_DEAD;
- break;
-
- case AVAHI_BROWSER_NOT_FOUND:
- client_output_printf(c, "%+i Not found\n", AVAHI_ERR_FAILURE);
+ client_output_printf(c, "%+i %s\n", avahi_server_errno(avahi_server), avahi_strerror(avahi_server_errno(avahi_server)));
c->state = CLIENT_DEAD;
break;