]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Remove master-service-settings-cache usage
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 29 Nov 2022 16:58:57 +0000 (18:58 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Jan 2023 13:01:47 +0000 (13:01 +0000)
src/login-common/login-settings.c
src/login-common/login-settings.h
src/login-common/main.c

index 64de67f085d7f8cae7f7a2f3ac2e9f02f7841c3f..a4ad808c0845154f4bd4be181393417d7ddd491c 100644 (file)
@@ -7,7 +7,6 @@
 #include "master-service.h"
 #include "master-service-settings.h"
 #include "master-service-ssl-settings.h"
-#include "master-service-settings-cache.h"
 #include "login-settings.h"
 
 #include <stddef.h>
@@ -97,8 +96,6 @@ static const struct setting_parser_info *default_login_set_roots[] = {
 
 const struct setting_parser_info **login_set_roots = default_login_set_roots;
 
-static struct master_service_settings_cache *set_cache;
-
 /* <settings checks> */
 static bool login_settings_check(void *_set, pool_t pool,
                                 const char **error_r)
@@ -168,6 +165,7 @@ login_settings_read(pool_t pool,
                    void ***other_settings_r)
 {
        struct master_service_settings_input input;
+       struct master_service_settings_output output;
        const char *error;
        struct setting_parser_context *parser;
        void **sets;
@@ -184,23 +182,10 @@ login_settings_read(pool_t pool,
        if (remote_ip != NULL)
                input.remote_ip = *remote_ip;
 
-       if (set_cache == NULL) {
-               set_cache = master_service_settings_cache_init(master_service,
-                                                              input.module,
-                                                              input.service);
-               /* lookup filters
-
-                  this is only enabled if service_count > 1 because otherwise
-                  login process will process only one request and this is only
-                  useful when more than one request is processed.
-               */
-               if (master_service_get_service_count(master_service) > 1)
-                       master_service_settings_cache_init_filter(set_cache);
-       }
-
-       if (master_service_settings_cache_read(set_cache, &input,
-                                              &parser, &error) < 0)
+       if (master_service_settings_read(master_service, &input,
+                                        &output, &error) < 0)
                i_fatal("Error reading configuration: %s", error);
+       parser = master_service_get_settings_parser(master_service);
 
        for (count = 0; input.roots[count] != NULL; count++) ;
        sets = p_new(pool, void *, count + 1);
@@ -220,9 +205,3 @@ login_settings_read(pool_t pool,
        *other_settings_r = sets + 1;
        return sets[0];
 }
-
-void login_settings_deinit(void)
-{
-       if (set_cache != NULL)
-               master_service_settings_cache_deinit(&set_cache);
-}
index 66711411b255ff82a1ae09049fff0aa4cc946635..8b93cb5092505af60c524234dae0b9f023acb0e9 100644 (file)
@@ -46,6 +46,5 @@ login_settings_read(pool_t pool,
                    const struct master_service_ssl_settings **ssl_set_r,
                    const struct master_service_ssl_server_settings **ssl_server_set_r,
                    void ***other_settings_r) ATTR_NULL(2, 3, 4);
-void login_settings_deinit(void);
 
 #endif
index 7dd2f7bfc6a564f4ae05105abfa0a15882d3cd9c..baf00c33a0adff7e0c909e9ec39b8b43af1735b4 100644 (file)
@@ -455,7 +455,6 @@ static void main_deinit(void)
        timeout_remove(&auth_client_to);
        client_common_deinit();
        dsasl_clients_deinit();
-       login_settings_deinit();
 }
 
 int login_binary_run(struct login_binary *binary,