From e2f7e83d25a5f0966938163c18b1fd8c399393b1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 3 Nov 2005 23:36:25 +0000 Subject: * allow the user to specify a static browse domain list in the configuration file * remove "drop-root" configuration variable * move the configuration variable "add-service-cookie" from [server] to [publish] * reorder AVAHI_DOMAIN_BROWSER_xx defs git-svn-id: file:///home/lennart/svn/public/avahi/trunk@926 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/server.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'avahi-core/server.c') diff --git a/avahi-core/server.c b/avahi-core/server.c index 3d53154..d92afac 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -1528,6 +1528,7 @@ AvahiServerConfig* avahi_server_config_init(AvahiServerConfig *c) { c->enable_wide_area = 0; c->n_wide_area_servers = 0; c->disallow_other_stacks = 0; + c->browse_domains = NULL; return c; } @@ -1537,10 +1538,12 @@ void avahi_server_config_free(AvahiServerConfig *c) { avahi_free(c->host_name); avahi_free(c->domain_name); + avahi_string_list_free(c->browse_domains); } AvahiServerConfig* avahi_server_config_copy(AvahiServerConfig *ret, const AvahiServerConfig *c) { char *d = NULL, *h = NULL; + AvahiStringList *l = NULL; assert(ret); assert(c); @@ -1553,10 +1556,17 @@ AvahiServerConfig* avahi_server_config_copy(AvahiServerConfig *ret, const AvahiS avahi_free(h); return NULL; } + + if (!(l = avahi_string_list_copy(c->browse_domains)) && c->browse_domains) { + avahi_free(h); + avahi_free(d); + return NULL; + } *ret = *c; ret->host_name = h; ret->domain_name = d; + ret->browse_domains = l; return ret; } -- cgit