]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't create a settings cache for initial global settings read.
authorTimo Sirainen <tss@iki.fi>
Sat, 21 Sep 2013 02:05:22 +0000 (05:05 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 21 Sep 2013 02:05:22 +0000 (05:05 +0300)
This fixes at least doveadm -A so that it doesn't connect to config process
for each user.

src/lib-storage/mail-storage-service.c

index 87ac94ccaf1bb0198f8377de50e7ff78fd929b75..fc4be24349fffdcae0cec107877609726fc30349 100644 (file)
@@ -864,7 +864,9 @@ int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
                set_input.local_ip = input->local_ip;
                set_input.remote_ip = input->remote_ip;
        }
-       if (ctx->set_cache == NULL) {
+       if (input == NULL) {
+               /* global settings read - don't create a cache for thi */
+       } else if (ctx->set_cache == NULL) {
                ctx->set_cache_module = p_strdup(ctx->pool, set_input.module);
                ctx->set_cache_service = p_strdup(ctx->pool, set_input.service);
                ctx->set_cache = master_service_settings_cache_init(
@@ -877,7 +879,8 @@ int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
 
        dyn_parsers = mail_storage_get_dynamic_parsers(pool);
        if (null_strcmp(set_input.module, ctx->set_cache_module) == 0 &&
-           null_strcmp(set_input.service, ctx->set_cache_service) == 0) {
+           null_strcmp(set_input.service, ctx->set_cache_service) == 0 &&
+           ctx->set_cache != NULL) {
                if (master_service_settings_cache_read(ctx->set_cache,
                                                       &set_input, dyn_parsers,
                                                       parser_r, error_r) < 0) {