- if (event == AVAHI_RESOLVER_FOUND) {
- int j;
- int32_t interface, flags, protocol, aprotocol;
- char *name, *type, *domain, *host, *address;
- uint16_t port;
- DBusMessageIter iter, sub;
- AvahiAddress a;
-
- if (!dbus_message_get_args(
- message, &error,
- DBUS_TYPE_INT32, &interface,
- DBUS_TYPE_INT32, &protocol,
- DBUS_TYPE_STRING, &name,
- DBUS_TYPE_STRING, &type,
- DBUS_TYPE_STRING, &domain,
- DBUS_TYPE_STRING, &host,
- DBUS_TYPE_INT32, &aprotocol,
- DBUS_TYPE_STRING, &address,
- DBUS_TYPE_UINT16, &port,
- DBUS_TYPE_INVALID) ||
- dbus_error_is_set (&error)) {
-
- fprintf(stderr, "Failed to parse resolver event.\n");
- goto fail;
- }
-
- dbus_message_iter_init(message, &iter);
-
- for (j = 0; j < 9; j++)
- dbus_message_iter_next(&iter);
-
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
- dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_ARRAY) {
- fprintf(stderr, "Error parsing service resolving message\n");
- goto fail;
- }
-
- strlst = NULL;
- dbus_message_iter_recurse(&iter, &sub);
-
- for (;;) {
- DBusMessageIter sub2;
- int at;
-
- if ((at = dbus_message_iter_get_arg_type(&sub)) == DBUS_TYPE_INVALID)
- break;
-
- assert(at == DBUS_TYPE_ARRAY);
-
- if (dbus_message_iter_get_element_type(&sub) != DBUS_TYPE_BYTE) {
+ switch (event) {
+ case AVAHI_RESOLVER_FOUND: {
+ int j;
+ int32_t interface, protocol, aprotocol;
+ uint32_t flags;
+ char *name, *type, *domain, *host, *address;
+ uint16_t port;
+ DBusMessageIter iter, sub;
+ AvahiAddress a;
+
+ if (!dbus_message_get_args(
+ message, &error,
+ DBUS_TYPE_INT32, &interface,
+ DBUS_TYPE_INT32, &protocol,
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_STRING, &type,
+ DBUS_TYPE_STRING, &domain,
+ DBUS_TYPE_STRING, &host,
+ DBUS_TYPE_INT32, &aprotocol,
+ DBUS_TYPE_STRING, &address,
+ DBUS_TYPE_UINT16, &port,
+ DBUS_TYPE_INVALID) ||
+ dbus_error_is_set (&error)) {
+
+ fprintf(stderr, "Failed to parse resolver event.\n");
+ goto fail;
+ }
+
+ dbus_message_iter_init(message, &iter);
+
+ for (j = 0; j < 9; j++)
+ dbus_message_iter_next(&iter);
+
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY ||
+ dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_ARRAY) {