]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Move config_apply_error() ealier
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 2 Feb 2024 07:49:21 +0000 (09:49 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
src/config/config-parser.c

index 0b39a1faf99441dd575594e15902783cc0be7874..0b3b4463db5297f78d3e8d44241452309f04615f 100644 (file)
@@ -304,6 +304,28 @@ fix_relative_path(const char *path, struct input_stack *input)
        return t_strconcat(t_strdup_until(input->path, p+1), path, NULL);
 }
 
+static int
+config_apply_error(struct config_parser_context *ctx, const char *key)
+{
+       struct config_parser_key *config_key;
+
+       /* Couldn't get value for the setting, but we're delaying error
+          handling. Mark all settings parsers containing this key as failed.
+          See config-parser.h for details. */
+       config_key = hash_table_lookup(ctx->all_keys, t_strcut(key, '/'));
+       if (config_key == NULL)
+               return -1;
+
+       for (; config_key != NULL; config_key = config_key->next) {
+               struct config_module_parser *l =
+                       &ctx->cur_section->filter_parser->module_parsers[config_key->info_idx];
+               if (l->delayed_error == NULL)
+                       l->delayed_error = ctx->error;
+               ctx->error = NULL;
+       }
+       return 0;
+}
+
 static int
 settings_value_check(struct config_parser_context *ctx,
                     const struct setting_parser_info *info,
@@ -796,28 +818,6 @@ int config_apply_line(struct config_parser_context *ctx,
                                      value, full_key_r, &root_setting);
 }
 
-static int
-config_apply_error(struct config_parser_context *ctx, const char *key)
-{
-       struct config_parser_key *config_key;
-
-       /* Couldn't get value for the setting, but we're delaying error
-          handling. Mark all settings parsers containing this key as failed.
-          See config-parser.h for details. */
-       config_key = hash_table_lookup(ctx->all_keys, t_strcut(key, '/'));
-       if (config_key == NULL)
-               return -1;
-
-       for (; config_key != NULL; config_key = config_key->next) {
-               struct config_module_parser *l =
-                       &ctx->cur_section->filter_parser->module_parsers[config_key->info_idx];
-               if (l->delayed_error == NULL)
-                       l->delayed_error = ctx->error;
-               ctx->error = NULL;
-       }
-       return 0;
-}
-
 static struct config_module_parser *
 config_module_parsers_init(pool_t pool)
 {