From: Lennart Poettering Date: Sun, 25 Sep 2005 23:46:25 +0000 (+0000) Subject: fix querier instantiation X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=b2839754a3d1e15a3009561e69b41608014af0cb;p=catta fix querier instantiation git-svn-id: file:///home/lennart/svn/public/avahi/trunk@629 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/browse.c b/avahi-core/browse.c index e8494ae..64680b7 100644 --- a/avahi-core/browse.c +++ b/avahi-core/browse.c @@ -569,9 +569,6 @@ void avahi_s_record_browser_cancel(AvahiSRecordBrowser *b) { avahi_time_event_free(b->defer_time_event); b->defer_time_event = NULL; } - - - } void avahi_s_record_browser_free(AvahiSRecordBrowser *b) { diff --git a/avahi-core/multicast-lookup.c b/avahi-core/multicast-lookup.c index 641ee4d..d46f940 100644 --- a/avahi-core/multicast-lookup.c +++ b/avahi-core/multicast-lookup.c @@ -110,6 +110,7 @@ AvahiMulticastLookup *avahi_multicast_lookup_new( AVAHI_LLIST_PREPEND(AvahiMulticastLookup, lookups, e->lookups, l); avahi_querier_add_for_all(e->server, interface, protocol, l->key, &ctime); + l->queriers_added = 1; /* add a second */ avahi_timeval_add(&ctime, 1000000); diff --git a/avahi-core/querier.c b/avahi-core/querier.c index 51b2ce6..a58d387 100644 --- a/avahi-core/querier.c +++ b/avahi-core/querier.c @@ -81,7 +81,7 @@ void avahi_querier_add(AvahiInterface *i, AvahiKey *key, struct timeval *ret_cti assert(i); assert(key); - + if ((q = avahi_hashmap_lookup(i->queriers_by_key, key))) { /* Someone is already browsing for records of this RR key */ q->n_used++; @@ -126,6 +126,7 @@ void avahi_querier_remove(AvahiInterface *i, AvahiKey *key) { } assert(q->n_used >= 1); + if ((--q->n_used) <= 0) avahi_querier_free(q); }