[dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.24, 1.25

cras at dovecot.org cras at dovecot.org
Thu Oct 21 20:16:35 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv2468/lib-index

Modified Files:
	mail-index-view-sync.c 
Log Message:
Crashfix



Index: mail-index-view-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view-sync.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- mail-index-view-sync.c	17 Oct 2004 18:24:21 -0000	1.24
+++ mail-index-view-sync.c	21 Oct 2004 17:16:32 -0000	1.25
@@ -10,6 +10,7 @@
 struct mail_index_view_sync_ctx {
 	struct mail_index_view *view;
 	enum mail_transaction_type trans_sync_mask;
+	struct mail_index_sync_map_ctx sync_map_ctx;
 	buffer_t *expunges;
 
 	const struct mail_transaction_header *hdr;
@@ -122,6 +123,9 @@
 	ctx->trans_sync_mask = want_mask;
 	ctx->expunges = expunges;
 
+	ctx->sync_map_ctx.view = view;
+	ctx->sync_map_ctx.last_ext_id = (uint32_t)-1;
+
 	if ((sync_mask & MAIL_INDEX_SYNC_TYPE_EXPUNGE) != 0) {
 		view->new_map = view->index->map;
 		view->new_map->refcount++;
@@ -202,13 +206,7 @@
 	   see only updated information. */
 	if (ctx->sync_map_update &&
 	    (ctx->hdr->type & MAIL_TRANSACTION_EXPUNGE) == 0) {
-		struct mail_index_sync_map_ctx sync_map_ctx;
-
-		memset(&sync_map_ctx, 0, sizeof(sync_map_ctx));
-		sync_map_ctx.view = view;
-		sync_map_ctx.last_ext_id = (uint32_t)-1;
-
-		if (mail_index_sync_record(&sync_map_ctx, ctx->hdr,
+		if (mail_index_sync_record(&ctx->sync_map_ctx, ctx->hdr,
 					   ctx->data) < 0)
 			return -1;
 	}



More information about the dovecot-cvs mailing list