From: Timo Sirainen Date: Sat, 21 Sep 2013 02:05:22 +0000 (+0300) Subject: lib-storage: Don't create a settings cache for initial global settings read. X-Git-Tag: 2.2.6~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2ca20a479e76af8557b4a74b0b51e4de0e3c9e3;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Don't create a settings cache for initial global settings read. This fixes at least doveadm -A so that it doesn't connect to config process for each user. --- diff --git a/src/lib-storage/mail-storage-service.c b/src/lib-storage/mail-storage-service.c index 87ac94ccaf..fc4be24349 100644 --- a/src/lib-storage/mail-storage-service.c +++ b/src/lib-storage/mail-storage-service.c @@ -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) {