X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-compat-libdns_sd%2Fcompat.c;h=ae1cfb22e86f1ba48a6a35466cd8c5a004862ea5;hb=2afb248985218ecb5c3b105ff04a986a506b59f9;hp=6fec3c96b40ee8bcfbc406bf478426f5af5d83cc;hpb=6f37f0e1126ad3776b80dbd64701f38a58738921;p=catta diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c index 6fec3c9..ae1cfb2 100644 --- a/avahi-compat-libdns_sd/compat.c +++ b/avahi-compat-libdns_sd/compat.c @@ -145,7 +145,7 @@ static DNSServiceErrorType map_error(int error) { case AVAHI_ERR_INVALID_CONFIG: case AVAHI_ERR_TIMEOUT: case AVAHI_ERR_DBUS_ERROR: - case AVAHI_ERR_NOT_CONNECTED: + case AVAHI_ERR_DISCONNECTED: case AVAHI_ERR_NO_DAEMON: break; @@ -481,7 +481,6 @@ static void generic_client_callback(AvahiClient *s, AvahiClientState state, void switch (state) { case AVAHI_CLIENT_FAILURE: - case AVAHI_CLIENT_DISCONNECTED: if (sdref->service_browser_callback) sdref->service_browser_callback(sdref, 0, 0, error, NULL, NULL, NULL, sdref->context); @@ -495,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; } } @@ -533,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; } @@ -646,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; } @@ -758,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; } @@ -862,7 +862,6 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us switch (state) { case AVAHI_CLIENT_FAILURE: - case AVAHI_CLIENT_DISCONNECTED: reg_report_error(sdref, kDNSServiceErr_Unknown); break; @@ -904,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; @@ -1016,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; }