[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c,1.24,1.25 mbox-storage.c,1.18,1.19

cras at procontrol.fi cras at procontrol.fi
Mon Nov 25 21:02:52 EET 2002


Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory danu:/tmp/cvs-serv2991/src/lib-storage/index/mbox

Modified Files:
	mbox-save.c mbox-storage.c 
Log Message:
Locking changes triggered a bit larger cleanup :) If we have to wait for a
lock longer, the client is now notified about it every 30 seconds. Also if
mailbox opening fails because of lock timeout, we won't overwrite the index
anymore. Finally user gets a clear error message about lock timeout instead
of "internal error".



Index: mbox-save.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-save.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- mbox-save.c	20 Nov 2002 18:31:15 -0000	1.24
+++ mbox-save.c	25 Nov 2002 19:02:50 -0000	1.25
@@ -218,8 +218,8 @@
 
 	/* kludgy.. for copying inside same mailbox. */
 	if (!ibox->delay_save_unlocking) {
-		if (!ibox->index->set_lock(ibox->index, MAIL_LOCK_UNLOCK))
-			return mail_storage_set_index_error(ibox);
+		if (!index_storage_lock(ibox, MAIL_LOCK_UNLOCK))
+			return FALSE;
 	}
 
 	return !failed;

Index: mbox-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- mbox-storage.c	20 Nov 2002 16:03:36 -0000	1.18
+++ mbox-storage.c	25 Nov 2002 19:02:50 -0000	1.19
@@ -76,11 +76,13 @@
 
 	storage->dir = i_strdup(data);
 	storage->user = i_strdup(user);
+	storage->callbacks = i_new(MailStorageCallbacks, 1);
 	return storage;
 }
 
 static void mbox_free(MailStorage *storage)
 {
+	i_free(storage->callbacks);
 	i_free(storage->dir);
 	i_free(storage->user);
 	i_free(storage);
@@ -397,6 +399,7 @@
 	mbox_create,
 	mbox_free,
 	mbox_autodetect,
+	index_storage_set_callbacks,
 	mbox_open_mailbox,
 	mbox_create_mailbox,
 	mbox_delete_mailbox,
@@ -409,7 +412,8 @@
 
 	NULL,
 	NULL,
-	NULL
+	NULL,
+	NULL, NULL
 };
 
 Mailbox mbox_mailbox = {
@@ -417,7 +421,6 @@
 	NULL, /* storage */
 
 	mbox_storage_close,
-	index_storage_set_sync_callbacks,
 	index_storage_get_status,
 	index_storage_sync,
 	index_storage_expunge,




More information about the dovecot-cvs mailing list