]> git.meshlink.io Git - catta/commitdiff
* correct fixes
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Aug 2005 23:09:50 +0000 (23:09 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Aug 2005 23:09:50 +0000 (23:09 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@222 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/server.c

index 087eafcb8d84006ddcf91dc48b2b3e5c2f9a9b7d..5426f5b3ae1e26d1552b12a8a7e1302bbd6e1d8f 100644 (file)
@@ -1947,10 +1947,8 @@ void avahi_entry_group_change_state(AvahiEntryGroup *g, AvahiEntryGroupState sta
 
     g->state = state;
     
-    if (g->callback) {
+    if (g->callback)
         g->callback(g->server, g, state, g->userdata);
-        return;
-    }
 }
 
 AvahiEntryGroup *avahi_entry_group_new(AvahiServer *s, AvahiEntryGroupCallback callback, gpointer userdata) {
@@ -2002,18 +2000,21 @@ void avahi_entry_group_free(AvahiEntryGroup *g) {
 static void entry_group_commit_real(AvahiEntryGroup *g) {
     g_assert(g);
 
-    avahi_announce_group(g->server, g);
-    avahi_entry_group_check_probed(g, FALSE);
-
     g_get_current_time(&g->register_time);
+
     avahi_entry_group_change_state(g, AVAHI_ENTRY_GROUP_REGISTERING);
+
+    if (!g->dead) {
+        avahi_announce_group(g->server, g);
+        avahi_entry_group_check_probed(g, FALSE);
+    }
 }
 
 static void entry_group_register_time_event_callback(AvahiTimeEvent *e, gpointer userdata) {
     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;
@@ -2042,13 +2043,13 @@ 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 */
+         /* Holdoff time has not yet passed, so let's wait */
         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);