[dovecot-cvs] dovecot: Sync transaction needs to be created later or we'll crash

dovecot at dovecot.org dovecot at dovecot.org
Tue May 22 21:28:37 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/e5f0e8cf6089
changeset: 5650:e5f0e8cf6089
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 22 21:28:19 2007 +0300
description:
Sync transaction needs to be created later or we'll crash

diffstat:

1 file changed, 5 insertions(+), 1 deletion(-)
src/lib-index/mail-index-sync.c |    6 +++++-

diffs (23 lines):

diff -r b0754b4d187d -r e5f0e8cf6089 src/lib-index/mail-index-sync.c
--- a/src/lib-index/mail-index-sync.c	Tue May 22 21:26:02 2007 +0300
+++ b/src/lib-index/mail-index-sync.c	Tue May 22 21:28:19 2007 +0300
@@ -408,7 +408,6 @@ int mail_index_sync_begin(struct mail_in
 	ctx->sync_dirty = sync_dirty;
 
 	ctx->view = mail_index_view_open(index);
-	ctx->ext_trans = mail_index_transaction_begin(ctx->view, FALSE, TRUE);
 
 	sync_view = mail_index_dummy_view_open(index);
 	ctx->sync_trans = mail_index_transaction_begin(sync_view, FALSE, TRUE);
@@ -456,6 +455,11 @@ int mail_index_sync_begin(struct mail_in
 	}
 
 	ctx->view->index_sync_view = TRUE;
+
+	/* create the transaction after the view has been updated with
+	   external transactions and marked as sync view */
+	ctx->ext_trans = mail_index_transaction_begin(ctx->view, FALSE, TRUE);
+
 	*ctx_r = ctx;
 	*view_r = ctx->view;
 	*trans_r = ctx->ext_trans;


More information about the dovecot-cvs mailing list