@@ -282,6 +282,7 @@ struct rspamd_config { | |||
GList *workers; /**< linked list of all workers params */ | |||
GHashTable *wrk_parsers; /**< hash for worker config parsers, indexed by worker quarks */ | |||
ucl_object_t *rcl_obj; /**< rcl object */ | |||
ucl_object_t *config_comments; /**< comments saved from the config */ | |||
ucl_object_t *doc_strings; /**< documentation strings for config options */ | |||
GHashTable * metrics; /**< hash of metrics indexed by metric name */ | |||
GList * metrics_list; /**< linked list of metrics */ |
@@ -2908,7 +2908,7 @@ rspamd_config_read (struct rspamd_config *cfg, const gchar *filename, | |||
rspamd_strlcpy (cfg->cfg_pool->tag.uid, cfg->checksum, | |||
MIN (sizeof (cfg->cfg_pool->tag.uid), strlen (cfg->checksum))); | |||
parser = ucl_parser_new (0); | |||
parser = ucl_parser_new (UCL_PARSER_SAVE_COMMENTS); | |||
rspamd_ucl_add_conf_variables (parser, vars); | |||
rspamd_ucl_add_conf_macros (parser, cfg); | |||
@@ -2921,6 +2921,7 @@ rspamd_config_read (struct rspamd_config *cfg, const gchar *filename, | |||
munmap (data, st.st_size); | |||
cfg->rcl_obj = ucl_parser_get_object (parser); | |||
cfg->config_comments = ucl_object_ref (ucl_parser_get_comments (parser)); | |||
ucl_parser_free (parser); | |||
top = rspamd_rcl_config_init (cfg); |
@@ -171,6 +171,7 @@ rspamd_config_free (struct rspamd_config *cfg) | |||
rspamd_map_remove_all (cfg); | |||
ucl_object_unref (cfg->rcl_obj); | |||
ucl_object_unref (cfg->config_comments); | |||
ucl_object_unref (cfg->doc_strings); | |||
g_hash_table_remove_all (cfg->metrics); | |||
g_hash_table_unref (cfg->metrics); |