#include <config.h>
#endif
+#include <stdlib.h>
+
#include <avahi-common/domain.h>
#include <avahi-common/malloc.h>
#include <avahi-common/error.h>
assert(e);
assert(b);
+ assert(b->type == AVAHI_DOMAIN_BROWSER_BROWSE);
+
avahi_time_event_free(b->defer_event);
b->defer_event = NULL;
inc_ref(b);
for (l = b->server->config.browse_domains; l; l = l->next) {
-
+
/* Check whether this object still exists outside our own
* stack frame */
if (b->ref <= 1)
break;
-
+
b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_NEW, (char*) l->text, AVAHI_LOOKUP_RESULT_STATIC, b->userdata);
}
b->record_browser = NULL;
b->type = type;
b->all_for_now_scheduled = 0;
+ b->defer_event = NULL;
AVAHI_LLIST_PREPEND(AvahiSDomainBrowser, browser, server->domain_browsers, b);
avahi_key_unref(k);
- b->defer_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
+ if (type == AVAHI_DOMAIN_BROWSER_BROWSE && b->server->config.browse_domains)
+ b->defer_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
return b;