degesch: set "user_data" while loading config
It'd be quite wrong to call "on_change" on them without this.
This commit is contained in:
14
degesch.c
14
degesch.c
@@ -1576,17 +1576,13 @@ static struct config_schema g_config_attributes[] =
|
||||
static void
|
||||
load_config_behaviour (struct config_item_ *subtree, void *user_data)
|
||||
{
|
||||
(void) user_data;
|
||||
// TODO: assign user_data to all the subitems
|
||||
config_schema_apply_to_object (g_config_behaviour, subtree);
|
||||
config_schema_apply_to_object (g_config_behaviour, subtree, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
load_config_attributes (struct config_item_ *subtree, void *user_data)
|
||||
{
|
||||
(void) user_data;
|
||||
// TODO: assign user_data to all the subitems
|
||||
config_schema_apply_to_object (g_config_attributes, subtree);
|
||||
config_schema_apply_to_object (g_config_attributes, subtree, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -8398,9 +8394,6 @@ load_server_from_config (struct app_context *ctx,
|
||||
struct server *s = xmalloc (sizeof *s);
|
||||
server_init (s, &ctx->poller);
|
||||
|
||||
// TODO: assign user_data (s) to all the subitems
|
||||
config_schema_apply_to_object (g_config_server, subtree);
|
||||
|
||||
s->ctx = ctx;
|
||||
s->name = xstrdup (name);
|
||||
str_map_set (&ctx->servers, s->name, s);
|
||||
@@ -8415,6 +8408,9 @@ load_server_from_config (struct app_context *ctx,
|
||||
buffer_add (ctx, buffer);
|
||||
buffer_activate (ctx, buffer);
|
||||
|
||||
// This fires any "on_change" callbacks
|
||||
config_schema_apply_to_object (g_config_server, subtree, s);
|
||||
|
||||
// XXX: is this desirable in here? I think we should do it only when
|
||||
// actually creating a new server instead of every time we load them.
|
||||
struct error *e = NULL;
|
||||
|
||||
Reference in New Issue
Block a user