]> git.meshlink.io Git - catta/blobdiff - avahi-core/server.c
* Disable shipping of Gentoo and SUSE init scripts for now since they are horribly...
[catta] / avahi-core / server.c
index 40ef6166d8d911006b4aad2748aafc826033660a..6ba8ea0ce7cde7bb1a537a3d411db62526790f1f 100644 (file)
@@ -35,6 +35,7 @@
 #include <avahi-common/domain.h>
 #include <avahi-common/timeval.h>
 #include <avahi-common/malloc.h>
+#include <avahi-common/error.h>
 
 #include "server.h"
 #include "iface.h"
@@ -1202,10 +1203,14 @@ static void register_stuff(AvahiServer *s) {
     assert(s);
 
     server_set_state(s, AVAHI_SERVER_REGISTERING);
+    s->n_host_rr_pending ++;  /** Make sure that the state isn't changed tp AVAHI_SERVER_RUNNING too early */
+
     register_hinfo(s);
     register_browse_domain(s);
     avahi_update_host_rrs(s->monitor, 0);
 
+    s->n_host_rr_pending --;
+    
     if (s->n_host_rr_pending == 0)
         server_set_state(s, AVAHI_SERVER_RUNNING);
 }