-static void record_browser_callback(AvahiRecordBrowser*rr, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, AvahiRecord *record, gpointer userdata) {
- AvahiServiceBrowser *b = userdata;
- gchar *n, *e, *c, *s;
- gchar service[128];
-
- g_assert(rr);
- g_assert(record);
- g_assert(b);
-
- g_assert(record->key->type == AVAHI_DNS_TYPE_PTR);
-
- c = n = avahi_normalize_name(record->data.ptr.name);
-
- if (!(avahi_unescape_label((const gchar**) &c, service, sizeof(service))))
- goto fail;
-
- for (s = e = c; *c == '_';) {
- c += strcspn(c, ".");
-
- if (*c == 0)
+static void record_browser_callback(
+ AvahiSRecordBrowser*rr,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiBrowserEvent event,
+ AvahiRecord *record,
+ AvahiLookupResultFlags flags,
+ void* userdata) {
+
+ AvahiSServiceBrowser *b = userdata;
+ char *n = NULL, *c = NULL, *s = NULL;
+ char service[128];
+
+ assert(rr);
+ assert(b);
+
+ if (record) {
+ char *e;
+ assert(record->key->type == AVAHI_DNS_TYPE_PTR);
+
+ c = n = avahi_normalize_name(record->data.ptr.name);
+
+ if (!(avahi_unescape_label((const char**) &c, service, sizeof(service))))
+ goto fail;
+
+ for (s = e = c; *c == '_';) {
+ c += strcspn(c, ".");
+
+ if (*c == 0)
+ goto fail;
+
+ assert(*c == '.');
+ e = c;
+ c++;
+ }
+
+ *e = 0;
+
+ if (!avahi_domain_equal(c, b->domain_name))