diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-11-16 01:15:46 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-11-16 01:15:46 +0000 |
commit | a3d45b39608418e261f34b3b3286b80e4878d25c (patch) | |
tree | 0743b13f2386f4e108dc8e6d17fc0d3cf18e4791 /avahi-core/entry.c | |
parent | 6ed9be1191edab688976f5ea7ddf1e382ef6f1d1 (diff) |
* when calculating a random jitter time for time events, use the same jitter in
every 10s timespans. This should increase the probability that multiple
responses can be merged into a single packet, and thus decreases network
traffic.
* add _workstation._tcp services in RUNNING state, not earlier
* an important bugfix which fixes the entry group state automatons
* remove obsolete debug messages
* minor other cleanups
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@980 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/entry.c')
-rw-r--r-- | avahi-core/entry.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/avahi-core/entry.c b/avahi-core/entry.c index d294647..5baaf40 100644 --- a/avahi-core/entry.c +++ b/avahi-core/entry.c @@ -1083,18 +1083,17 @@ static void entry_group_commit_real(AvahiSEntryGroup *g) { avahi_s_entry_group_change_state(g, AVAHI_ENTRY_GROUP_REGISTERING); - if (!g->dead) { - avahi_announce_group(g->server, g); - avahi_s_entry_group_check_probed(g, 0); - } + if (g->dead) + return; + + avahi_announce_group(g->server, g); + avahi_s_entry_group_check_probed(g, 0); } static void entry_group_register_time_event_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* userdata) { AvahiSEntryGroup *g = userdata; assert(g); -/* avahi_log_debug("Holdoff passed, waking up and going on."); */ - avahi_time_event_free(g->register_time_event); g->register_time_event = NULL; @@ -1121,12 +1120,10 @@ int avahi_s_entry_group_commit(AvahiSEntryGroup *g) { gettimeofday(&now, NULL); if (avahi_timeval_compare(&g->register_time, &now) <= 0) { - /* Holdoff time passed, so let's start probing */ -/* avahi_log_debug("Holdoff passed, directly going on."); */ + /* Holdoff time passed, so let's start probing */ entry_group_commit_real(g); } else { -/* avahi_log_debug("Holdoff not passed, sleeping."); */ /* Holdoff time has not yet passed, so let's wait */ assert(!g->register_time_event); |