From: Lennart Poettering Date: Thu, 29 Sep 2005 16:25:44 +0000 (+0000) Subject: reset the the commit throttling counter for entry groups 5s afer they have been estab... X-Git-Tag: upstream/0.6.31~1139 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e133abe5892f1fd6414b33e2fafc20734a3b5f4;p=platform%2Fupstream%2Favahi.git reset the the commit throttling counter for entry groups 5s afer they have been established successfully git-svn-id: file:///home/lennart/svn/public/avahi/trunk@651 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/server.c b/avahi-core/server.c index 49821d8..cdf31e8 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -2274,6 +2274,22 @@ void avahi_s_entry_group_change_state(AvahiSEntryGroup *g, AvahiEntryGroupState assert(state <= AVAHI_ENTRY_GROUP_COLLISION); + if (g->state == AVAHI_ENTRY_GROUP_ESTABLISHED) { + + /* If the entry group was established for a time longer then + * 5s, reset the establishment trial counter */ + + if (avahi_age(&g->established_at) > 5000000) + g->n_register_try = 0; + } + + if (state == AVAHI_ENTRY_GROUP_ESTABLISHED) + + /* If the entry group is now established, remember the time + * this happened */ + + gettimeofday(&g->established_at, NULL); + g->state = state; if (g->callback) diff --git a/avahi-core/server.h b/avahi-core/server.h index 3e439f9..1723250 100644 --- a/avahi-core/server.h +++ b/avahi-core/server.h @@ -88,6 +88,8 @@ struct AvahiSEntryGroup { unsigned n_register_try; struct timeval register_time; AvahiTimeEvent *register_time_event; + + struct timeval established_at; AVAHI_LLIST_FIELDS(AvahiSEntryGroup, groups); AVAHI_LLIST_HEAD(AvahiEntry, entries); diff --git a/docs/TODO b/docs/TODO index 233d665..6a90889 100644 --- a/docs/TODO +++ b/docs/TODO @@ -3,14 +3,12 @@ for 0.6: * add subtype browsing * add simplification routine for adding services -* remove queries from queue if the browse object they were issued from is destroyed +* remove outgoing queries from queue if the browse object they were issued from is destroyed * add API to allow user to tell the server that some service is not reachable * Add static host configuration like static services [lathiat] -* reset commit throttling for entry groups after a while - * consolidate browsing failure events and add an API to query the reason * generate local CNAME responses @@ -90,3 +88,4 @@ done: * add option to disable SO_REUSEADDR to disallow binding of multiple processes to port 5353 * add flags argument to disable cookies-setting for local services * add API to add addresses without reverse PTR record +* reset commit throttling for entry groups after a while