]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/dbus-async-service-resolver.c
fix avahi_netlink_new to allow multiple netlinks per process
[catta] / avahi-daemon / dbus-async-service-resolver.c
index efb5202b0b111079502af488d8b8230120e15386..2b58e2d13d90009195c25df8addb9c53e33caecc 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -46,8 +44,8 @@ void avahi_dbus_async_service_resolver_free(AsyncServiceResolverInfo *i) {
 
     AVAHI_LLIST_REMOVE(AsyncServiceResolverInfo, async_service_resolvers, i->client->async_service_resolvers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -75,6 +73,11 @@ void avahi_dbus_async_service_resolver_callback(
 
     reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_RESOLVER, avahi_dbus_map_resolve_signal_name(event));
 
+    if (!reply) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_RESOLVER_FOUND) {
         char t[AVAHI_ADDRESS_STR_MAX], *pt = t;
         int32_t i_interface, i_protocol, i_aprotocol;
@@ -149,7 +152,7 @@ DBusHandlerResult avahi_dbus_msg_async_service_resolver_impl(DBusConnection *c,
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "ServiceResolver.introspect");
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.ServiceResolver.xml");
 
     /* Access control */
     if (strcmp(dbus_message_get_sender(m), i->client->name))
@@ -174,4 +177,3 @@ fail:
 
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
-