dovecot-2.2: lib-storage: Added mail_storage_service_set_auth_co...

dovecot at dovecot.org dovecot at dovecot.org
Mon Nov 18 16:19:14 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/c6f1909e52af
changeset: 16980:c6f1909e52af
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 18 16:15:38 2013 +0200
description:
lib-storage: Added mail_storage_service_set_auth_conn()

diffstat:

 src/lib-storage/mail-storage-service.c |  18 ++++++++++++------
 src/lib-storage/mail-storage-service.h |   3 +++
 2 files changed, 15 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 5870a1656b9f -r c6f1909e52af src/lib-storage/mail-storage-service.c
--- a/src/lib-storage/mail-storage-service.c	Mon Nov 18 15:46:46 2013 +0200
+++ b/src/lib-storage/mail-storage-service.c	Mon Nov 18 16:15:38 2013 +0200
@@ -913,6 +913,16 @@
 	return -1;
 }
 
+void mail_storage_service_set_auth_conn(struct mail_storage_service_ctx *ctx,
+					struct auth_master_connection *conn)
+{
+	i_assert(ctx->conn == NULL);
+	i_assert(mail_user_auth_master_conn == NULL);
+
+	ctx->conn = conn;
+	mail_user_auth_master_conn = conn;
+}
+
 static void
 mail_storage_service_first_init(struct mail_storage_service_ctx *ctx,
 				const struct setting_parser_info *user_info,
@@ -920,17 +930,13 @@
 {
 	enum auth_master_flags flags = 0;
 
-	i_assert(ctx->conn == NULL);
-
 	ctx->debug = mail_user_set_get_mail_debug(user_info, user_set);
 	if (ctx->debug)
 		flags |= AUTH_MASTER_FLAG_DEBUG;
 	if ((ctx->flags & MAIL_STORAGE_SERVICE_FLAG_NO_IDLE_TIMEOUT) != 0)
 		flags |= AUTH_MASTER_FLAG_NO_IDLE_TIMEOUT;
-	ctx->conn = auth_master_init(user_set->auth_socket_path, flags);
-
-	i_assert(mail_user_auth_master_conn == NULL);
-	mail_user_auth_master_conn = ctx->conn;
+	mail_storage_service_set_auth_conn(ctx,
+		auth_master_init(user_set->auth_socket_path, flags));
 }
 
 static void
diff -r 5870a1656b9f -r c6f1909e52af src/lib-storage/mail-storage-service.h
--- a/src/lib-storage/mail-storage-service.h	Mon Nov 18 15:46:46 2013 +0200
+++ b/src/lib-storage/mail-storage-service.h	Mon Nov 18 16:15:38 2013 +0200
@@ -62,6 +62,9 @@
 			  enum mail_storage_service_flags flags) ATTR_NULL(2);
 struct auth_master_connection *
 mail_storage_service_get_auth_conn(struct mail_storage_service_ctx *ctx);
+/* Set auth connection (instead of creating a new one automatically). */
+void mail_storage_service_set_auth_conn(struct mail_storage_service_ctx *ctx,
+					struct auth_master_connection *conn);
 int mail_storage_service_read_settings(struct mail_storage_service_ctx *ctx,
 				       const struct mail_storage_service_input *input,
 				       pool_t pool,


More information about the dovecot-cvs mailing list