[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-copy.c,1.13,1.14 maildir-storage.c,1.15,1.16

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/maildir
In directory danu:/tmp/cvs-serv2991/src/lib-storage/index/maildir

Modified Files:
	maildir-copy.c maildir-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: maildir-copy.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-copy.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- maildir-copy.c	4 Nov 2002 04:47:40 -0000	1.13
+++ maildir-copy.c	25 Nov 2002 19:02:50 -0000	1.14
@@ -69,8 +69,7 @@
 	ret = index_messageset_foreach(src, messageset, uidset,
 				       copy_hard_func, &ctx);
 
-	if (!src->index->set_lock(src->index, MAIL_LOCK_UNLOCK))
-		mail_storage_set_index_error(src);
+	(void)index_storage_lock(src, MAIL_LOCK_UNLOCK);
 
 	return ctx.error ? -1 : ret;
 }

Index: maildir-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- maildir-storage.c	20 Nov 2002 16:06:24 -0000	1.15
+++ maildir-storage.c	25 Nov 2002 19:02:50 -0000	1.16
@@ -53,11 +53,13 @@
 
 	storage->dir = i_strdup(data);
 	storage->user = i_strdup(user);
+	storage->callbacks = i_new(MailStorageCallbacks, 1);
 	return storage;
 }
 
 static void maildir_free(MailStorage *storage)
 {
+	i_free(storage->callbacks);
 	i_free(storage->dir);
 	i_free(storage->user);
 	i_free(storage);
@@ -438,6 +440,7 @@
 	maildir_create,
 	maildir_free,
 	maildir_autodetect,
+	index_storage_set_callbacks,
 	maildir_open_mailbox,
 	maildir_create_mailbox,
 	maildir_delete_mailbox,
@@ -450,7 +453,8 @@
 
 	NULL,
 	NULL,
-	NULL
+	NULL,
+	NULL, NULL
 };
 
 Mailbox maildir_mailbox = {
@@ -458,7 +462,6 @@
 	NULL, /* storage */
 
 	index_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