]> git.meshlink.io Git - catta/blobdiff - avahi-core/browse-service-type.c
forgot to pull the publish_no_reverse change to the example.
[catta] / avahi-core / browse-service-type.c
index 39bf4712cdfa090466d9f22b4e802d853cdbc043..6fff07165221812c20c85c247623fb5ecd600220 100644 (file)
@@ -1,18 +1,16 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -52,15 +50,18 @@ static void record_browser_callback(
     AvahiRecord *record,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    
+
     AvahiSServiceTypeBrowser *b = userdata;
 
     assert(rr);
     assert(b);
 
+    /* Filter flags */
+    flags &= AVAHI_LOOKUP_RESULT_CACHED | AVAHI_LOOKUP_RESULT_MULTICAST | AVAHI_LOOKUP_RESULT_WIDE_AREA;
+
     if (record) {
         char type[AVAHI_DOMAIN_NAME_MAX], domain[AVAHI_DOMAIN_NAME_MAX];
-        
+
         assert(record->key->type == AVAHI_DNS_TYPE_PTR);
 
         if (avahi_service_name_split(record->data.ptr.name, NULL, 0, type, sizeof(type), domain, sizeof(domain)) < 0) {
@@ -81,12 +82,12 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
     AvahiLookupFlags flags,
     AvahiSServiceTypeBrowserCallback callback,
     void* userdata) {
-    
+
     AvahiSServiceTypeBrowser *b;
     AvahiKey *k = NULL;
     char n[AVAHI_DOMAIN_NAME_MAX];
     int r;
-    
+
     assert(server);
     assert(callback);
 
@@ -102,32 +103,32 @@ AvahiSServiceTypeBrowser *avahi_s_service_type_browser_new(
         avahi_server_set_errno(server, r);
         return NULL;
     }
-    
+
     if (!(b = avahi_new(AvahiSServiceTypeBrowser, 1))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         return NULL;
     }
-    
+
     b->server = server;
     b->callback = callback;
     b->userdata = userdata;
     b->record_browser = NULL;
-    
+
     AVAHI_LLIST_PREPEND(AvahiSServiceTypeBrowser, browser, server->service_type_browsers, b);
 
     if (!(b->domain_name = avahi_normalize_name_strdup(domain))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR))) {
         avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
         goto fail;
     }
-    
+
     if (!(b->record_browser = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, b)))
         goto fail;
-        
+
     avahi_key_unref(k);
 
     return b;
@@ -137,7 +138,7 @@ fail:
         avahi_key_unref(k);
 
     avahi_s_service_type_browser_free(b);
-    
+
     return NULL;
 }