diff src/lib-storage/index/mbox/mbox-storage.c @ 296:d66aa1f1fb2d HEAD

Added fast-flag for mailbox opening, which doesn't do any index compressing or cache updating. This flag is set when mailbox is opened by APPEND, COPY or STATUS (ie. not SELECT/EXAMINE).
author Timo Sirainen <tss@iki.fi>
date Mon, 23 Sep 2002 13:42:20 +0300
parents 95d21ab87eeb
children 21a9d15025c7
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-storage.c	Mon Sep 23 13:30:21 2002 +0300
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Mon Sep 23 13:42:20 2002 +0300
@@ -149,7 +149,8 @@
 	(void)create_mbox_index_dirs(path, TRUE);
 }
 
-static Mailbox *mbox_open(MailStorage *storage, const char *name, int readonly)
+static Mailbox *mbox_open(MailStorage *storage, const char *name,
+			  int readonly, int fast)
 {
 	IndexMailbox *ibox;
 	const char *path, *index_dir;
@@ -162,14 +163,14 @@
 
 	ibox = index_storage_init(storage, &mbox_mailbox,
 				  mbox_index_alloc(index_dir, path),
-				  name, readonly);
+				  name, readonly, fast);
 	if (ibox != NULL)
 		ibox->expunge_locked = mbox_expunge_locked;
 	return (Mailbox *) ibox;
 }
 
 static Mailbox *mbox_open_mailbox(MailStorage *storage, const char *name,
-				  int readonly)
+				  int readonly, int fast)
 {
 	struct stat st;
 	char path[1024];
@@ -180,7 +181,7 @@
 	if (strcasecmp(name, "INBOX") == 0) {
 		/* make sure inbox exists */
 		verify_inbox(storage);
-		return mbox_open(storage, "inbox", readonly);
+		return mbox_open(storage, "inbox", readonly, fast);
 	}
 
 	if (!mbox_is_valid_name(storage, name)) {
@@ -193,7 +194,7 @@
 		/* exists - make sure the required directories are also there */
 		(void)create_mbox_index_dirs(path, TRUE);
 
-		return mbox_open(storage, name, readonly);
+		return mbox_open(storage, name, readonly, fast);
 	} else if (errno == ENOENT) {
 		mail_storage_set_error(storage, "Mailbox doesn't exist: %s",
 				       name);