From 4f0a5e7572a4257894b4bfede42c26d65152609e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 13 Aug 2005 21:25:09 +0000 Subject: * strip glib from avahi-core * implement glib memory allocator * add new documentation file MALLOC * initialize pseudo-RNG from /dev/urandom in avahi-daemon * remove some gcc 4.0 warnings * beef up watch system with real timeouts * move GCC __attribute__ macros into its own header avahi-common/gccmacro.h * make use of GCC's sentinel attribute where it make sense * add malloc() implementations that abort on OOM and enable them by default git-svn-id: file:///home/lennart/svn/public/avahi/trunk@308 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-daemon/simple-protocol.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'avahi-daemon/simple-protocol.c') diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c index 39af043..12d8adb 100644 --- a/avahi-daemon/simple-protocol.c +++ b/avahi-daemon/simple-protocol.c @@ -164,12 +164,19 @@ static void client_output_printf(Client *c, const gchar *format, ...) { } -static void host_name_resolver_callback(AvahiHostNameResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *hostname, const AvahiAddress *a, gpointer userdata) { +static void host_name_resolver_callback( + AvahiHostNameResolver *r, + AvahiIfIndex iface, + AvahiProtocol protocol, + AvahiResolverEvent event, + const char *hostname, + const AvahiAddress *a, + void* userdata) { + Client *c = userdata; g_assert(c); - if (event == AVAHI_RESOLVER_TIMEOUT) client_output_printf(c, "%+i Query timed out\n", AVAHI_ERR_TIMEOUT); else { @@ -181,9 +188,16 @@ static void host_name_resolver_callback(AvahiHostNameResolver *r, AvahiIfIndex i c->state = CLIENT_DEAD; } -static void address_resolver_callback(AvahiAddressResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiBrowserEvent event, const AvahiAddress *a, const gchar *hostname, gpointer userdata) { - Client *c = userdata; +static void address_resolver_callback( + AvahiAddressResolver *r, + AvahiIfIndex iface, + AvahiProtocol protocol, + AvahiResolverEvent event, + const AvahiAddress *a, + const char *hostname, + void* userdata) { + Client *c = userdata; g_assert(c); @@ -195,7 +209,7 @@ static void address_resolver_callback(AvahiAddressResolver *r, AvahiIfIndex ifac c->state = CLIENT_DEAD; } -static void dns_server_browser_callback(AvahiDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *host_name, const AvahiAddress *a, guint16 port, gpointer userdata) { +static void dns_server_browser_callback(AvahiDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *host_name, const AvahiAddress *a, uint16_t port, void* userdata) { Client *c = userdata; gchar t[64]; -- cgit