X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fsimple-protocol.c;h=d53987d610fa4d99acecf86aa87520cf1f0a7799;hb=feae35a24a8d234ae5a4eb629cd09c905f74dc04;hp=26d67ea56fc14cbcc5c41cd027083ccc45ef961a;hpb=2c453196ee040e17e357f3431b0647391c88d616;p=catta diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c index 26d67ea..d53987d 100644 --- a/avahi-daemon/simple-protocol.c +++ b/avahi-daemon/simple-protocol.c @@ -164,7 +164,6 @@ static void client_output_printf(Client *c, const char *format, ...) { avahi_free(t); } - static void host_name_resolver_callback( AvahiSHostNameResolver *r, AvahiIfIndex iface, @@ -179,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); @@ -208,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); @@ -241,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;