- i_interface = (int32_t) interface;
- i_protocol = (int32_t) protocol;
-
- if (!dbus_message_append_args(
- message,
- DBUS_TYPE_INT32, &i_interface,
- DBUS_TYPE_INT32, &i_protocol,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_STRING, &type,
- DBUS_TYPE_STRING, &domain,
- DBUS_TYPE_INVALID)) {
- avahi_client_set_errno (client, AVAHI_ERR_NO_MEMORY);
- goto fail;
- }
-
- reply = dbus_connection_send_with_reply_and_block (client->bus, message, -1, &error);
-
- if (!reply || dbus_error_is_set (&error))
- goto fail;
-
- if (!dbus_message_get_args (reply, &error, DBUS_TYPE_BOOLEAN, &b, DBUS_TYPE_INVALID) ||
- dbus_error_is_set (&error))
- goto fail;
-
- dbus_message_unref(message);
- dbus_message_unref(reply);
-
- return b;
-
-fail:
-
- if (message)
- dbus_message_unref(message);
- if (reply)
- dbus_message_unref(reply);
-
- if (dbus_error_is_set(&error)) {
- avahi_client_set_dbus_error(client, &error);
- dbus_error_free(&error);
- }
-
- return AVAHI_SERVICE_COOKIE_INVALID;