From: jan Date: Thu, 20 Aug 2015 13:58:37 +0000 (+0200) Subject: fix backend #705 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=f5d4215d93887fda552b8f5f52ea506e01d9a748;p=catta fix backend #705 Avoiding a state change callback while still constructing catta server, so the callback can expect to have a readily constructed catta server available. This changes the behaviour and catta will only change into running state when at least one network interface is found and used. --- diff --git a/src/server.c b/src/server.c index fffbfdf..b397196 100644 --- a/src/server.c +++ b/src/server.c @@ -1220,7 +1220,7 @@ static void register_stuff(CattaServer *s) { assert(s); server_set_state(s, CATTA_SERVER_REGISTERING); - s->n_host_rr_pending ++; /** Make sure that the state isn't changed tp CATTA_SERVER_RUNNING too early */ + s->n_host_rr_pending ++; /** Make sure that the state isn't changed to CATTA_SERVER_RUNNING too early */ register_hinfo(s); register_browse_domain(s); @@ -1228,9 +1228,6 @@ static void register_stuff(CattaServer *s) { assert(s->n_host_rr_pending > 0); s->n_host_rr_pending --; - - if (s->n_host_rr_pending == 0) - server_set_state(s, CATTA_SERVER_RUNNING); } static void update_fqdn(CattaServer *s) {