summaryrefslogtreecommitdiffstats
path: root/avahi-core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-28 23:50:08 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-28 23:50:08 +0200
commit4cee342544b5d31022462ba522eed9959ebbd9dd (patch)
tree01b65735b01d848cbdf36a71185f1a9784abbe79 /avahi-core
parent955093014c992318a1b52758a8e01627bb0a82f2 (diff)
core: fix counting of workstation services that are in the process of being registered
Fixes http://avahi.org/ticket/276
Diffstat (limited to 'avahi-core')
-rw-r--r--avahi-core/iface.c9
-rw-r--r--avahi-core/server.c1
2 files changed, 7 insertions, 3 deletions
diff --git a/avahi-core/iface.c b/avahi-core/iface.c
index 38dfde1..ad83fe4 100644
--- a/avahi-core/iface.c
+++ b/avahi-core/iface.c
@@ -90,12 +90,12 @@ void avahi_interface_address_update_rrs(AvahiInterfaceAddress *a, int remove_rrs
char t[AVAHI_ADDRESS_STR_MAX];
avahi_address_snprint(t, sizeof(t), &a->address);
+ avahi_log_info("Withdrawing address record for %s on %s.", t, a->interface->hardware->name);
+
if (avahi_s_entry_group_get_state(a->entry_group) == AVAHI_ENTRY_GROUP_REGISTERING &&
m->server->state == AVAHI_SERVER_REGISTERING)
avahi_server_decrease_host_rr_pending(m->server);
- avahi_log_info("Withdrawing address record for %s on %s.", t, a->interface->hardware->name);
-
avahi_s_entry_group_reset(a->entry_group);
}
}
@@ -151,7 +151,10 @@ void avahi_hw_interface_update_rrs(AvahiHwInterface *hw, int remove_rrs) {
if (hw->entry_group && !avahi_s_entry_group_is_empty(hw->entry_group)) {
- if (avahi_s_entry_group_get_state(hw->entry_group) == AVAHI_ENTRY_GROUP_REGISTERING)
+ avahi_log_info("Withdrawing workstation service for %s.", hw->name);
+
+ if (avahi_s_entry_group_get_state(hw->entry_group) == AVAHI_ENTRY_GROUP_REGISTERING &&
+ m->server->state == AVAHI_SERVER_REGISTERING)
avahi_server_decrease_host_rr_pending(m->server);
avahi_s_entry_group_reset(hw->entry_group);
diff --git a/avahi-core/server.c b/avahi-core/server.c
index 6c7c4e2..a149f0f 100644
--- a/avahi-core/server.c
+++ b/avahi-core/server.c
@@ -1215,6 +1215,7 @@ static void register_stuff(AvahiServer *s) {
register_browse_domain(s);
avahi_interface_monitor_update_rrs(s->monitor, 0);
+ assert(s->n_host_rr_pending > 0);
s->n_host_rr_pending --;
if (s->n_host_rr_pending == 0)