]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: config_filter_parsers_get() - Remove unused modules parameter
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 18 Dec 2022 22:05:52 +0000 (00:05 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Jan 2023 13:01:47 +0000 (13:01 +0000)
src/config/config-filter.c
src/config/config-filter.h
src/config/config-parser.c
src/config/config-request.c

index edbd0459f3022ddaa57bfb1ab0c10c96056bae73..193347bfe1535ea006d315e74b21058945c84803 100644 (file)
@@ -185,17 +185,12 @@ static bool str_array_contains(ARRAY_TYPE(const_string) *arr, const char *str)
        return FALSE;
 }
 
-static bool have_changed_settings(const struct config_filter_parser *parser,
-                                 const char *const *modules)
+static bool have_changed_settings(const struct config_filter_parser *parser)
 {
        const unsigned char *changes;
        unsigned int i, j, size;
 
        for (i = 0; parser->parsers[i].root != NULL; i++) {
-               if (!config_module_want_parser(config_module_parsers,
-                                              modules, parser->parsers[i].root))
-                       continue;
-
                changes = settings_parser_get_changes(parser->parsers[i].parser);
                size = parser->parsers[i].root->struct_size;
                for (j = 0; j < size; j++) {
@@ -208,7 +203,6 @@ static bool have_changed_settings(const struct config_filter_parser *parser,
 
 static struct config_filter_parser *const *
 config_filter_find_all(struct config_filter_context *ctx, pool_t pool,
-                      const char *const *modules,
                       const struct config_filter *filter,
                       struct master_service_settings_output *output_r)
 {
@@ -225,7 +219,7 @@ config_filter_find_all(struct config_filter_context *ctx, pool_t pool,
 
                if (!config_filter_match_service(mask, filter)) {
                        if (!str_array_contains(&service_names, mask->service) &&
-                           have_changed_settings(ctx->parsers[i], modules))
+                           have_changed_settings(ctx->parsers[i]))
                                array_push_back(&service_names,
                                                &mask->service);
                        continue;
@@ -320,7 +314,6 @@ config_module_parser_apply_changes(struct config_module_parser *dest,
 }
 
 int config_filter_parsers_get(struct config_filter_context *ctx, pool_t pool,
-                             const char *const *modules,
                              const struct config_filter *filter,
                              struct config_module_parser **parsers_r,
                              struct master_service_settings_output *output_r,
@@ -336,7 +329,7 @@ int config_filter_parsers_get(struct config_filter_context *ctx, pool_t pool,
           with an error. Merging SET_STRLIST types requires
           settings_parser_apply_changes() to work a bit unintuitively by
           letting the destination settings override the source settings. */
-       src = config_filter_find_all(ctx, pool, modules, filter, output_r);
+       src = config_filter_find_all(ctx, pool, filter, output_r);
 
        /* all of them should have the same number of parsers.
           duplicate our initial parsers from the first match */
index 7e45fc1a772058e03dfb72f44de6a2815bfd46ae..a9dfd8ed1bfbf4252034941cb50fba1def000826 100644 (file)
@@ -33,7 +33,6 @@ void config_filter_add_all(struct config_filter_context *ctx,
 
 /* Build new parsers from all existing ones matching the given filter. */
 int config_filter_parsers_get(struct config_filter_context *ctx, pool_t pool,
-                             const char *const *modules,
                              const struct config_filter *filter,
                              struct config_module_parser **parsers_r,
                              struct master_service_settings_output *output_r,
index a81a98b9de02090c1908e0b163b4cc098d8a1801..099b577a407585d96d689fc9d9db1eb64067c74f 100644 (file)
@@ -433,7 +433,7 @@ config_all_parsers_check(struct config_parser_context *ctx,
 
        global_ssl_set = get_str_setting(parsers[0], "ssl", "");
        for (i = 0; i < count && ret == 0; i++) {
-               if (config_filter_parsers_get(new_filter, tmp_pool, NULL,
+               if (config_filter_parsers_get(new_filter, tmp_pool,
                                              &parsers[i]->filter,
                                              &tmp_parsers, &output,
                                              error_r) < 0) {
index edb089c9fa292750aea536762b7e40adfa301b9c..9e1019dd183e1b03f58938f8211e58b0b639944d 100644 (file)
@@ -403,8 +403,7 @@ void config_export_by_filter(struct config_export_context *ctx,
 {
        const char *error;
 
-       if (config_filter_parsers_get(config_filter, ctx->pool,
-                                     NULL, filter,
+       if (config_filter_parsers_get(config_filter, ctx->pool, filter,
                                      &ctx->dup_parsers, &ctx->output,
                                      &error) < 0) {
                i_error("%s", error);