Mercurial > dovecot > core-2.2
diff src/lib-storage/index/dbox-multi/mdbox-storage.c @ 14564:7dd1dd742825
mdbox: mailbox_update() didn't look at the latest index data.
So setting min_next_uid, min_first_recent_uid or min_highest_modseq may have
actually shrank them.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 15 May 2012 18:52:41 +0300 |
parents | ba770cba5598 |
children | 924b0d57338c 6b9db780b47d |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-multi/mdbox-storage.c Mon May 14 21:07:43 2012 +0300 +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c Tue May 15 18:52:41 2012 +0300 @@ -249,6 +249,7 @@ { struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)box; struct mail_index_transaction *new_trans = NULL; + struct mail_index_view *view; const struct mail_index_header *hdr; uint32_t uid_validity, uid_next; @@ -260,7 +261,8 @@ trans = new_trans; } - hdr = mail_index_get_header(box->view); + view = mail_index_view_open(box->index); + hdr = mail_index_get_header(view); uid_validity = hdr->uid_validity; if (update != NULL && update->uid_validity != 0) uid_validity = update->uid_validity; @@ -293,12 +295,12 @@ &first_recent_uid, sizeof(first_recent_uid), FALSE); } if (update != NULL && update->min_highest_modseq != 0 && - mail_index_modseq_get_highest(box->view) < - update->min_highest_modseq) { + mail_index_modseq_get_highest(view) < update->min_highest_modseq) { mail_index_modseq_enable(box->index); mail_index_update_highest_modseq(trans, update->min_highest_modseq); } + mail_index_view_close(&view); mdbox_update_header(mbox, trans, update); if (new_trans != NULL) {