dovecot-2.0: quota: Fixed updating quota when sync_notify() had ...

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 11 20:48:36 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/8c6912bc0db0
changeset: 11978:8c6912bc0db0
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 11 18:48:30 2010 +0100
description:
quota: Fixed updating quota when sync_notify() had been called outside regular syncing.

diffstat:

 src/plugins/quota/quota-storage.c |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (29 lines):

diff -r 6b22e2a8c534 -r 8c6912bc0db0 src/plugins/quota/quota-storage.c
--- a/src/plugins/quota/quota-storage.c	Wed Aug 11 17:09:51 2010 +0100
+++ b/src/plugins/quota/quota-storage.c	Wed Aug 11 18:48:30 2010 +0100
@@ -327,6 +327,17 @@
 	return ret;
 }
 
+static void quota_mailbox_close(struct mailbox *box)
+{
+	struct quota_mailbox *qbox = QUOTA_CONTEXT(box);
+
+	/* sync_notify() may be called outside sync_begin()..sync_deinit().
+	   make sure we apply changes at close time at latest. */
+	quota_mailbox_sync_commit(qbox);
+
+	qbox->module_ctx.super.close(box);
+}
+
 static int
 quota_mailbox_delete_shrink_quota(struct mailbox *box)
 {
@@ -403,6 +414,7 @@
 	v->copy = quota_copy;
 	v->sync_notify = quota_mailbox_sync_notify;
 	v->sync_deinit = quota_mailbox_sync_deinit;
+	v->close = quota_mailbox_close;
 	v->delete = quota_mailbox_delete;
 	v->free = quota_mailbox_free;
 	MODULE_CONTEXT_SET(box, quota_storage_module, qbox);


More information about the dovecot-cvs mailing list