--- /usr/tmp/clean/avahi-0.6.28/avahi-core/server.c 2010-08-26 01:51:38.993153000 +0100 +++ avahi-0.6.28/avahi-core/server.c 2011-01-20 12:44:02.347982322 +0000 @@ -1074,7 +1074,9 @@ s->state = state; +#ifndef HAVE_BONJOUR avahi_interface_monitor_update_rrs(s->monitor, 0); +#endif if (s->callback) s->callback(s, state, s->userdata); @@ -1211,9 +1213,11 @@ 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 */ +#ifndef HAVE_BONJOUR register_hinfo(s); register_browse_domain(s); avahi_interface_monitor_update_rrs(s->monitor, 0); +#endif assert(s->n_host_rr_pending > 0); s->n_host_rr_pending --; @@ -1373,6 +1377,10 @@ else avahi_server_config_init(&s->config); +#ifdef HAVE_BONJOUR + s->need_service_cleanup = 0; + s->cleanup_time_event = NULL; +#else if ((e = setup_sockets(s)) < 0) { if (error) *error = e; @@ -1382,7 +1390,7 @@ return NULL; } - +#endif s->n_host_rr_pending = 0; s->need_entry_cleanup = 0; s->need_group_cleanup = 0; @@ -1428,6 +1436,12 @@ s->local_service_cookie = (uint32_t) rand() * (uint32_t) rand(); } while (s->local_service_cookie == AVAHI_SERVICE_COOKIE_INVALID); +#ifdef HAVE_BONJOUR + AVAHI_LLIST_HEAD_INIT(AvahiService, s->services); + s->wide_area_lookup_engine = NULL; + s->multicast_lookup_engine = NULL; + s->monitor = NULL; +#else if (s->config.enable_wide_area) { s->wide_area_lookup_engine = avahi_wide_area_engine_new(s); avahi_wide_area_set_servers(s->wide_area_lookup_engine, s->config.wide_area_servers, s->config.n_wide_area_servers); @@ -1438,6 +1452,7 @@ s->monitor = avahi_interface_monitor_new(s); avahi_interface_monitor_sync(s->monitor); +#endif register_localhost(s); register_stuff(s); @@ -1472,7 +1487,8 @@ while(s->entries) avahi_entry_free(s, s->entries); - avahi_interface_monitor_free(s->monitor); + if (s->monitor) + avahi_interface_monitor_free(s->monitor); while (s->groups) avahi_entry_group_free(s, s->groups); @@ -1485,7 +1501,8 @@ if (s->wide_area_lookup_engine) avahi_wide_area_engine_free(s->wide_area_lookup_engine); - avahi_multicast_lookup_engine_free(s->multicast_lookup_engine); + if (s->multicast_lookup_engine) + avahi_multicast_lookup_engine_free(s->multicast_lookup_engine); if (s->cleanup_time_event) avahi_time_event_free(s->cleanup_time_event); @@ -1524,6 +1541,11 @@ avahi_server_config_free(&s->config); +#ifdef HAVE_BONJOUR + if (s->cleanup_time_event) + avahi_time_event_free(s->cleanup_time_event); +#endif + avahi_free(s); }