From c38b02743d3a21112947af6689f34c1f00853c05 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 3 Aug 2005 22:25:32 +0000 Subject: * drop AVAHI_ENTRY_GROUP_SLEEPING git-svn-id: file:///home/lennart/svn/public/avahi/trunk@218 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/core.h | 3 +-- avahi-core/server.c | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'avahi-core') diff --git a/avahi-core/core.h b/avahi-core/core.h index aa6b809..25e9c0a 100644 --- a/avahi-core/core.h +++ b/avahi-core/core.h @@ -83,8 +83,7 @@ typedef enum { AVAHI_ENTRY_GROUP_UNCOMMITED = -1, /**< The group has not yet been commited, the user must still call avahi_entry_group_commit() */ AVAHI_ENTRY_GROUP_REGISTERING = 0, /**< The entries of the group are currently being registered */ AVAHI_ENTRY_GROUP_ESTABLISHED, /**< The entries have successfully been established */ - AVAHI_ENTRY_GROUP_COLLISION, /**< A name collision for one of the entries in the group has been detected, the entries have been withdrawn */ - AVAHI_ENTRY_GROUP_SLEEPING /**< Rate limiting of probe packets is active */ + AVAHI_ENTRY_GROUP_COLLISION /**< A name collision for one of the entries in the group has been detected, the entries have been withdrawn */ } AvahiEntryGroupState; /** Prototype for callback functions which are called whenever the state of an AvahiServer object changes */ diff --git a/avahi-core/server.c b/avahi-core/server.c index e3929db..18459b6 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -1131,10 +1131,12 @@ void avahi_host_rr_entry_group_callback(AvahiServer *s, AvahiEntryGroup *g, Avah if (state == AVAHI_ENTRY_GROUP_REGISTERING && s->state == AVAHI_SERVER_REGISTERING) avahi_server_increase_host_rr_pending(s); + else if (state == AVAHI_ENTRY_GROUP_COLLISION && (s->state == AVAHI_SERVER_REGISTERING || s->state == AVAHI_SERVER_RUNNING)) { withdraw_host_rrs(s); server_set_state(s, AVAHI_SERVER_COLLISION); + } else if (state == AVAHI_ENTRY_GROUP_ESTABLISHED && s->state == AVAHI_SERVER_REGISTERING) avahi_server_decrease_host_rr_pending(s); @@ -2011,7 +2013,7 @@ static void entry_group_register_time_event_callback(AvahiTimeEvent *e, gpointer AvahiEntryGroup *g = userdata; g_assert(g); - avahi_log_debug("Holdoff passed, waking up and going on."); +/* avahi_log_debug("Holdoff passed, waking up and going on."); */ avahi_time_event_queue_remove(g->server->time_event_queue, g->register_time_event); g->register_time_event = NULL; @@ -2040,14 +2042,14 @@ gint avahi_entry_group_commit(AvahiEntryGroup *g) { 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."); +/* avahi_log_debug("Holdoff passed, directly going on."); */ entry_group_commit_real(g); } else { - avahi_log_debug("Holdoff not passed, sleeping."); +/* avahi_log_debug("Holdoff not passed, sleeping."); */ /* Holdoff time has not yet passed, so let's wait */ - avahi_entry_group_change_state(g, AVAHI_ENTRY_GROUP_SLEEPING); + avahi_entry_group_change_state(g, AVAHI_ENTRY_GROUP_REGISTERING); g_assert(!g->register_time_event); g->register_time_event = avahi_time_event_queue_add(g->server->time_event_queue, &g->register_time, entry_group_register_time_event_callback, g); -- cgit