dovecot-2.0: dict quota: Quota recalculation always doubled the ...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 16 18:18:03 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/7a7bfdd708ff
changeset: 11553:7a7bfdd708ff
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 16 16:17:52 2010 +0100
description:
dict quota: Quota recalculation always doubled the quota with pgsql.

diffstat:

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

diffs (14 lines):

diff -r a74f743e2c56 -r 7a7bfdd708ff src/plugins/quota/quota-dict.c
--- a/src/plugins/quota/quota-dict.c	Tue Jun 15 17:54:12 2010 +0100
+++ b/src/plugins/quota/quota-dict.c	Wed Jun 16 16:17:52 2010 +0100
@@ -115,6 +115,10 @@
 
 	T_BEGIN {
 		dt = dict_transaction_begin(root->dict);
+		/* these unsets are mainly necessary for pgsql, because its
+		   trigger otherwise increases quota without deleting it */
+		dict_unset(dt, DICT_QUOTA_CURRENT_BYTES_PATH);
+		dict_unset(dt, DICT_QUOTA_CURRENT_COUNT_PATH);
 		dict_set(dt, DICT_QUOTA_CURRENT_BYTES_PATH, dec2str(bytes));
 		dict_set(dt, DICT_QUOTA_CURRENT_COUNT_PATH, dec2str(count));
 	} T_END;


More information about the dovecot-cvs mailing list