static void defer_callback(AvahiTimeEvent *e, void *userdata) {
    AvahiSDomainBrowser *b = userdata;
    AvahiStringList *l;

    assert(e);
    assert(b);

    assert(b->type == AVAHI_DOMAIN_BROWSER_BROWSE);

    avahi_time_event_free(b->defer_event);
    b->defer_event = NULL;

    /* Increase ref counter */
    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);
    }

    if (b->ref > 1) {
        /* If the ALL_FOR_NOW event has already been scheduled, execute it now */

        if (b->all_for_now_scheduled)
            b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_ALL_FOR_NOW, NULL, 0, b->userdata);
    }

    /* Decrease ref counter */
    avahi_s_domain_browser_free(b);
}
static void defer_callback(AvahiTimeEvent *e, void *userdata) {
    AvahiSDomainBrowser *b = userdata;
    AvahiStringList *l;

    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) {

         
        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);
    }

    if (b->ref > 1) {
         

        if (b->all_for_now_scheduled)
            b->callback(b, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_ALL_FOR_NOW, NULL, 0, b->userdata);
    }

     
    avahi_s_domain_browser_free(b);
}