]> git.meshlink.io Git - catta/blobdiff - avahi-compat-libdns_sd/compat.c
* Adding the missing files for Mandriva init.d
[catta] / avahi-compat-libdns_sd / compat.c
index 70ccd4b1ef3141b08508a6ad027851e01956fab4..052c8b2b8444858b6f7cea451819c095e63f524e 100644 (file)
@@ -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;
 
@@ -479,8 +479,8 @@ static void generic_client_callback(AvahiClient *s, AvahiClientState state, void
     assert(sdref->n_ref >= 1);
 
     switch (state) {
-            
-        case AVAHI_CLIENT_DISCONNECTED:
+
+        case AVAHI_CLIENT_FAILURE:
 
             if (sdref->service_browser_callback)
                 sdref->service_browser_callback(sdref, 0, 0, error, NULL, NULL, NULL, sdref->context);
@@ -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;
     }
 }
@@ -516,7 +517,6 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse(
     
     assert(ret_sdref);
     assert(regtype);
-    assert(domain);
     assert(callback);
 
     if (interface == kDNSServiceInterfaceIndexLocalOnly || flags != 0) {
@@ -532,7 +532,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 +645,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 +757,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;
     }
@@ -860,7 +860,7 @@ static void reg_client_callback(AvahiClient *s, AvahiClientState state, void* us
         return;
     
     switch (state) {
-        case AVAHI_CLIENT_DISCONNECTED:
+        case AVAHI_CLIENT_FAILURE:
             reg_report_error(sdref, kDNSServiceErr_Unknown);
             break;
 
@@ -902,6 +902,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 +1015,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;
     }