From 6ecd227ceadc32ed229246aa61df6361c7b58a95 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 8 Nov 2005 21:56:28 +0000 Subject: * add new flags parameter to avahi_client_new() * introduce flags AVAHI_CLIENT_NO_FAIL and AVAHI_CLIENT_IGNORE_USER_CONFIG * beef up avahi-browse to show how AVAHI_CLIENT_NO_FAIL may be used: add a new parameter "-f" which tells avahi-browse to stay running when the daemon disconnects from DBUS and reconnect when it reappears. For now dbus-daemon restarts are not handled and result in an AVAHI_CLIENT_FAIL event. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@937 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-compat-libdns_sd/compat.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'avahi-compat-libdns_sd') diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c index 432bb38..ae1cfb2 100644 --- a/avahi-compat-libdns_sd/compat.c +++ b/avahi-compat-libdns_sd/compat.c @@ -494,6 +494,7 @@ static void generic_client_callback(AvahiClient *s, AvahiClientState state, void case AVAHI_CLIENT_S_RUNNING: case AVAHI_CLIENT_S_COLLISION: case AVAHI_CLIENT_S_REGISTERING: + case AVAHI_CLIENT_CONNECTING: break; } } @@ -532,7 +533,7 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse( ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex)); - if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), generic_client_callback, sdref, &error))) { + if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, generic_client_callback, sdref, &error))) { ret = map_error(error); goto finish; } @@ -645,7 +646,7 @@ DNSServiceErrorType DNSSD_API DNSServiceResolve( ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex)); - if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), generic_client_callback, sdref, &error))) { + if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, generic_client_callback, sdref, &error))) { ret = map_error(error); goto finish; } @@ -757,7 +758,7 @@ DNSServiceErrorType DNSSD_API DNSServiceEnumerateDomains( ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex)); - if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), generic_client_callback, sdref, &error))) { + if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, generic_client_callback, sdref, &error))) { ret = map_error(error); goto finish; } @@ -902,6 +903,7 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us break; + case AVAHI_CLIENT_CONNECTING: case AVAHI_CLIENT_S_REGISTERING: /* Ignore */ break; @@ -1014,7 +1016,7 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister ( ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex)); - if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), reg_client_callback, sdref, &error))) { + if (!(sdref->client = avahi_client_new(avahi_simple_poll_get(sdref->simple_poll), 0, reg_client_callback, sdref, &error))) { ret = map_error(error); goto finish; } -- cgit