// Setup a dictionary from server.
service->dictionary = 0;
- service->settings = nmem_malloc(nmem, sizeof(struct settings));
+ service->settings = nmem_malloc(nmem, sizeof(*service->settings));
service->settings->num_settings = PZ_MAX_EOF;
service->settings->settings = nmem_malloc(nmem, sizeof(struct setting*) * service->settings->num_settings);
memset(service->settings->settings, 0, sizeof(struct setting*) * service->settings->num_settings);
continue;
if (!strcmp((const char *) n->name, "settings"))
{
+ int ret;
xmlChar *src = xmlGetProp(n, (xmlChar *) "src");
if (src)
{
WRBUF w = wrbuf_alloc();
conf_dir_path(server->config, w, (const char *) src);
- settings_read_file(service, wrbuf_cstr(w), pass);
+ ret = settings_read_file(service, wrbuf_cstr(w), pass);
wrbuf_destroy(w);
xmlFree(src);
}
else
{
- settings_read_node(service, n, pass);
+ ret = settings_read_node(service, n, pass);
}
+ if (ret)
+ return 0;
}
}
}
return service;
}
-static void inherit_server_settings(struct conf_service *s)
+static int inherit_server_settings(struct conf_service *s)
{
+ int ret = 0;
struct conf_server *server = s->server;
if (!s->dictionary) /* service has no config settings ? */
{
{
/* inherit settings from server */
init_settings(s);
- settings_read_file(s, server->settings_fname, 1);
- settings_read_file(s, server->settings_fname, 2);
+ if (settings_read_file(s, server->settings_fname, 1))
+ ret = -1;
+ if (settings_read_file(s, server->settings_fname, 2))
+ ret = -1;
}
else
{
s->charsets = pp2_charset_fact_create();
}
}
+ return ret;
}
struct conf_service *service_create(struct conf_server *server,