dovecot-1.1: If UIDVALIDITY changes and view hasn't noticed it y...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Jul 21 03:21:30 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/ea00b1553ef1
changeset: 7785:ea00b1553ef1
user: Timo Sirainen <tss at iki.fi>
date: Mon Jul 21 03:21:25 2008 +0300
description:
If UIDVALIDITY changes and view hasn't noticed it yet, don't assert-crash
when saving messages.
diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
src/lib-index/mail-index-transaction.c | 7 +++++--
diffs (21 lines):
diff -r 8552ad35c523 -r ea00b1553ef1 src/lib-index/mail-index-transaction.c
--- a/src/lib-index/mail-index-transaction.c Mon Jul 21 03:05:27 2008 +0300
+++ b/src/lib-index/mail-index-transaction.c Mon Jul 21 03:21:25 2008 +0300
@@ -533,12 +533,15 @@ void mail_index_transaction_sort_appends
uint32_t mail_index_transaction_get_next_uid(struct mail_index_transaction *t)
{
- const struct mail_index_header *hdr;
+ const struct mail_index_header *head_hdr, *hdr;
const struct mail_index_record *recs;
unsigned int count, offset;
uint32_t next_uid;
- next_uid = t->reset ? 1 : t->view->map->hdr.next_uid;
+ head_hdr = &t->view->index->map->hdr;
+ hdr = &t->view->map->hdr;
+ next_uid = t->reset || head_hdr->uid_validity != hdr->uid_validity ?
+ 1 : hdr->next_uid;
if (array_is_created(&t->appends)) {
/* get next_uid from appends if they have UIDs */
mail_index_transaction_sort_appends(t);
More information about the dovecot-cvs
mailing list