+
+ if (!(i->address_resolver = avahi_address_resolver_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, &a, address_resolver_callback, i))) {
+ address_resolver_free(i);
+ avahi_log_warn("Failed to create address resolver");
+ goto fail;
+ }
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+
+ } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "DomainBrowserNew")) {
+ Client *client;
+ DomainBrowserInfo *i;
+ static const DBusObjectPathVTable vtable = {
+ NULL,
+ msg_domain_browser_impl,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ };
+ DBusMessage *reply;
+ gint32 interface, protocol, type;
+ gchar *domain;
+
+
+ if (!dbus_message_get_args(
+ m, &error,
+ DBUS_TYPE_INT32, &interface,
+ DBUS_TYPE_INT32, &protocol,
+ DBUS_TYPE_STRING, &domain,
+ DBUS_TYPE_INT32, &type,
+ DBUS_TYPE_INVALID) || type < 0 || type >= AVAHI_DOMAIN_BROWSER_MAX) {
+ avahi_log_warn("Error parsing Server::DomainBrowserNew message");
+ goto fail;
+ }
+
+ client = client_get(dbus_message_get_sender(m), TRUE);
+
+ if (!*domain)
+ domain = NULL;
+
+ i = g_new(DomainBrowserInfo, 1);
+ i->id = ++client->current_id;
+ i->client = client;
+ i->path = g_strdup_printf("/org/freedesktop/Avahi/Client%u/DomainBrowser%u", client->id, i->id);
+
+ AVAHI_LLIST_PREPEND(DomainBrowserInfo, domain_browsers, client->domain_browsers, i);
+
+ if (!(i->domain_browser = avahi_domain_browser_new(avahi_server, (AvahiIfIndex) interface, (AvahiProtocol) protocol, domain, (AvahiDomainBrowserType) type, domain_browser_callback, i))) {
+ avahi_log_warn("Failed to create domain browser");
+ domain_browser_free(i);
+ goto fail;
+ }
+
+ dbus_connection_register_object_path(c, i->path, &vtable, i);
+ reply = dbus_message_new_method_return(m);
+ dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &i->path, DBUS_TYPE_INVALID);
+ dbus_connection_send(c, reply, NULL);
+ dbus_message_unref(reply);