From: Lennart Poettering Date: Wed, 23 Nov 2005 22:28:15 +0000 (+0000) Subject: in the domain browser objects: don't return statically configured browsing domains... X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=f6a388c0b603fa1913da7a5db4737e2c162f9547;p=catta in the domain browser objects: don't return statically configured browsing domains when the user asked for registration domains git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1022 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-client/browser.c b/avahi-client/browser.c index a8a823e..24393b8 100644 --- a/avahi-client/browser.c +++ b/avahi-client/browser.c @@ -200,7 +200,7 @@ AvahiDomainBrowser* avahi_domain_browser_new( goto fail; } - if (db->static_browse_domains) { + if (db->static_browse_domains && btype == AVAHI_DOMAIN_BROWSER_BROWSE) { struct timeval tv = { 0, 0 }; if (!(db->defer_timeout = client->poll_api->timeout_new(client->poll_api, &tv, defer_timeout_callback, db))) { diff --git a/avahi-core/browse-domain.c b/avahi-core/browse-domain.c index 4c78832..9b2beb0 100644 --- a/avahi-core/browse-domain.c +++ b/avahi-core/browse-domain.c @@ -106,6 +106,8 @@ static void defer_callback(AvahiTimeEvent *e, void *userdata) { assert(e); assert(b); + assert(b->type == AVAHI_DOMAIN_BROWSER_BROWSE); + avahi_time_event_free(b->defer_event); b->defer_event = NULL; @@ -113,12 +115,12 @@ static void defer_callback(AvahiTimeEvent *e, void *userdata) { 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); } @@ -198,7 +200,8 @@ AvahiSDomainBrowser *avahi_s_domain_browser_new( 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;