dovecot-2.0-sslstream: mail storage service: Fixed iterating thr...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:55:28 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/9df00624855b
changeset: 10149:9df00624855b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Oct 22 21:00:22 2009 -0400
description:
mail storage service: Fixed iterating through all users.

diffstat:

1 file changed, 23 insertions(+)
src/lib-storage/mail-storage-service.c |   23 +++++++++++++++++++++++

diffs (38 lines):

diff -r ef1ca7e1a9f9 -r 9df00624855b src/lib-storage/mail-storage-service.c
--- a/src/lib-storage/mail-storage-service.c	Thu Oct 22 20:53:27 2009 -0400
+++ b/src/lib-storage/mail-storage-service.c	Thu Oct 22 21:00:22 2009 -0400
@@ -803,11 +803,34 @@ void mail_storage_service_user_free(stru
 	pool_unref(&user->pool);
 }
 
+static void
+mail_storage_service_all_init_first(struct mail_storage_service_ctx *ctx)
+{
+	const struct setting_parser_info *user_info;
+	const struct mail_user_settings *user_set;
+	const char *error;
+	void **sets;
+	pool_t temp_pool;
+
+	temp_pool = pool_alloconly_create("service all settings", 4096);
+	if (mail_storage_service_read_settings(ctx, NULL, temp_pool,
+					       &user_info, &error) < 0)
+		i_fatal("%s", error);
+	sets = settings_parser_get_list(ctx->service->set_parser);
+	user_set = sets[1];
+
+	mail_storage_service_first_init(ctx, user_info, user_set);
+	pool_unref(&temp_pool);
+}
+
 unsigned int
 mail_storage_service_all_init(struct mail_storage_service_ctx *ctx)
 {
 	if (ctx->auth_list != NULL)
 		(void)auth_master_user_list_deinit(&ctx->auth_list);
+	if (ctx->conn == NULL)
+		mail_storage_service_all_init_first(ctx);
+
 	ctx->auth_list = auth_master_user_list_init(ctx->conn);
 	return auth_master_user_list_count(ctx->auth_list);
 }


More information about the dovecot-cvs mailing list