]> git.meshlink.io Git - catta/blobdiff - avahi-core/entry.c
core: Bug fixes for cleanup code
[catta] / avahi-core / entry.c
index e2a7c6c270b84d719e10b1bff898b94937ebe852..749fae5a4bce6adff4fa5333e39c2b1385ac6c99 100644 (file)
@@ -161,6 +161,11 @@ static int check_record_conflict(AvahiServer *s, AvahiIfIndex interface, AvahiPr
         if ((flags & AVAHI_PUBLISH_ALLOW_MULTIPLE) && (e->flags & AVAHI_PUBLISH_ALLOW_MULTIPLE) )
             continue;
 
+        if (avahi_record_equal_no_ttl(r, e->record)) {
+            /* The records are the same, not a conflict in any case */
+            continue;
+        }
+
         if ((interface <= 0 ||
              e->interface <= 0 ||
              e->interface == interface) &&
@@ -1082,6 +1087,8 @@ void avahi_s_entry_group_free(AvahiSEntryGroup *g) {
     
     g->server->need_group_cleanup = 1;
     g->server->need_entry_cleanup = 1;
+
+    avahi_cleanup_dead_entries(g->server);
 }
 
 static void entry_group_commit_real(AvahiSEntryGroup *g) {
@@ -1161,6 +1168,8 @@ void avahi_s_entry_group_reset(AvahiSEntryGroup *g) {
     g->n_probing = 0;
 
     avahi_s_entry_group_change_state(g, AVAHI_ENTRY_GROUP_UNCOMMITED);
+
+    avahi_cleanup_dead_entries(g->server);
 }
 
 int avahi_entry_is_commited(AvahiEntry *e) {