dovecot-2.2: lib-storage: Don't create a settings cache for init...

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 21 05:05:37 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/2323c451150f
changeset: 16798:2323c451150f
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Sep 21 05:05:22 2013 +0300
description:
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.

diffstat:

 src/lib-storage/mail-storage-service.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 8b3634d4c362 -r 2323c451150f src/lib-storage/mail-storage-service.c
--- a/src/lib-storage/mail-storage-service.c	Sat Sep 21 05:03:03 2013 +0300
+++ b/src/lib-storage/mail-storage-service.c	Sat Sep 21 05:05:22 2013 +0300
@@ -864,7 +864,9 @@
 		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 @@
 
 	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) {


More information about the dovecot-cvs mailing list