]> git.meshlink.io Git - catta/commitdiff
in the domain browser objects: don't return statically configured browsing domains...
authorLennart Poettering <lennart@poettering.net>
Wed, 23 Nov 2005 22:28:15 +0000 (22:28 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 23 Nov 2005 22:28:15 +0000 (22:28 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1022 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-client/browser.c
avahi-core/browse-domain.c

index a8a823ebe1c719224e203550c9068f7806bb7edc..24393b8b6837f53ad921b360e97fa01d3e646d6e 100644 (file)
@@ -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))) {
index 4c78832def09ccca253067c25537b02b84b74571..9b2beb02356f072baa5adff273ad68acad9612fe 100644 (file)
@@ -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;