[dovecot-cvs] dovecot/src/lib-index mail-index-sync-private.h, 1.11, 1.12 mail-index-sync.c, 1.31, 1.32 mail-index.h, 1.130, 1.131

cras at dovecot.org cras at dovecot.org
Mon Oct 4 19:31:53 EEST 2004


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

Modified Files:
	mail-index-sync-private.h mail-index-sync.c mail-index.h 
Log Message:
When we had dirty messages, we kept resyncing the whole mailbox constantly.



Index: mail-index-sync-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-private.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- mail-index-sync-private.h	4 Jul 2004 22:19:49 -0000	1.11
+++ mail-index-sync-private.h	4 Oct 2004 16:31:51 -0000	1.12
@@ -22,6 +22,7 @@
 	unsigned int lock_id;
 
 	unsigned int sync_appends:1;
+	unsigned int sync_dirty:1;
 };
 
 struct mail_index_sync_map_ctx {

Index: mail-index-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- mail-index-sync.c	5 Sep 2004 17:53:45 -0000	1.31
+++ mail-index-sync.c	4 Oct 2004 16:31:51 -0000	1.32
@@ -202,7 +202,8 @@
 	size_t size;
 	int ret;
 
-	if (ctx->view->map->hdr->flags & MAIL_INDEX_HDR_FLAG_HAVE_DIRTY) {
+	if ((ctx->view->map->hdr->flags & MAIL_INDEX_HDR_FLAG_HAVE_DIRTY) &&
+	    ctx->sync_dirty) {
 		/* show dirty flags as flag updates */
 		if (mail_index_sync_add_dirty_updates(ctx) < 0)
 			return -1;
@@ -248,7 +249,7 @@
                           struct mail_index_sync_ctx **ctx_r,
 			  struct mail_index_view **view_r,
 			  uint32_t log_file_seq, uoff_t log_file_offset,
-			  int sync_recent)
+			  int sync_recent, int sync_dirty)
 {
 	struct mail_index_sync_ctx *ctx;
 	uint32_t seq;
@@ -279,6 +280,7 @@
 	ctx = i_new(struct mail_index_sync_ctx, 1);
 	ctx->index = index;
 	ctx->lock_id = lock_id;
+	ctx->sync_dirty = sync_dirty;
 
 	ctx->view = mail_index_view_open(index);
 	ctx->view->external = TRUE;

Index: mail-index.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.h,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- mail-index.h	3 Oct 2004 16:32:59 -0000	1.130
+++ mail-index.h	4 Oct 2004 16:31:51 -0000	1.131
@@ -207,7 +207,7 @@
 			  struct mail_index_sync_ctx **ctx_r,
 			  struct mail_index_view **view_r,
 			  uint32_t log_file_seq, uoff_t log_file_offset,
-			  int sync_recent);
+			  int sync_recent, int sync_dirty);
 /* Returns -1 if error, 0 if sync is finished, 1 if record was filled. */
 int mail_index_sync_next(struct mail_index_sync_ctx *ctx,
 			 struct mail_index_sync_rec *sync_rec);



More information about the dovecot-cvs mailing list