[dovecot-cvs] dovecot/src/lib-index/maildir maildir-index.h,1.22,1.23 maildir-rebuild.c,1.13,1.14 maildir-sync.c,1.53,1.54

cras at procontrol.fi cras at procontrol.fi
Sun Jun 15 07:42:31 EEST 2003


Update of /home/cvs/dovecot/src/lib-index/maildir
In directory danu:/tmp/cvs-serv23333/lib-index/maildir

Modified Files:
	maildir-index.h maildir-rebuild.c maildir-sync.c 
Log Message:
Only NOOP and CHECK will now always do a real mailbox sync. Other commands
will also do it but no often than once in 5 seconds. Also with maildir we
don't anymore try to sync it before running commands since syncing is now
done automatically whenever we try to access a file that doesn't exist.



Index: maildir-index.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/maildir/maildir-index.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- maildir-index.h	15 Jun 2003 02:20:52 -0000	1.22
+++ maildir-index.h	15 Jun 2003 03:42:28 -0000	1.23
@@ -30,7 +30,7 @@
 int maildir_index_rebuild(struct mail_index *index);
 int maildir_index_sync_readonly(struct mail_index *index,
 				const char *fname, int *found);
-int maildir_index_sync(struct mail_index *index,
+int maildir_index_sync(struct mail_index *index, int minimal_sync,
 		       enum mail_lock_type lock_type, int *changes);
 
 int maildir_index_append_file(struct mail_index *index, const char *dir,

Index: maildir-rebuild.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/maildir/maildir-rebuild.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- maildir-rebuild.c	23 Apr 2003 17:07:23 -0000	1.13
+++ maildir-rebuild.c	15 Jun 2003 03:42:28 -0000	1.14
@@ -44,7 +44,7 @@
 	}
 
 	/* read the mails by syncing */
-	if (!index->sync_and_lock(index, MAIL_LOCK_UNLOCK, NULL))
+	if (!index->sync_and_lock(index, FALSE, MAIL_LOCK_UNLOCK, NULL))
 		return FALSE;
 
 	/* rebuild is complete - remove the flag */

Index: maildir-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/maildir/maildir-sync.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- maildir-sync.c	15 Jun 2003 02:20:52 -0000	1.53
+++ maildir-sync.c	15 Jun 2003 03:42:28 -0000	1.54
@@ -1337,7 +1337,7 @@
 	return ret;
 }
 
-int maildir_index_sync(struct mail_index *index,
+int maildir_index_sync(struct mail_index *index, int minimal_sync,
 		       enum mail_lock_type data_lock_type __attr_unused__,
 		       int *changes)
 {
@@ -1348,6 +1348,9 @@
 
 	if (changes != NULL)
 		*changes = FALSE;
+
+	if (minimal_sync)
+		return TRUE;
 
 	ctx = maildir_sync_context_new(index);
 	ret = maildir_index_sync_context(ctx, changes);



More information about the dovecot-cvs mailing list