Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6714:700555e06849 HEAD
If messages are unexpectedly lost from index file, log an error instead of
assert-crashing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 06 Nov 2007 23:56:22 +0200 |
parents | cfdf3b2e3dd3 |
children | 5f5c9095633c |
files | src/lib-index/mail-index-view-sync.c |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-view-sync.c Tue Nov 06 23:50:57 2007 +0200 +++ b/src/lib-index/mail-index-view-sync.c Tue Nov 06 23:56:22 2007 +0200 @@ -321,10 +321,19 @@ } if (sync_expunges || !view_sync_have_expunges(view)) { + if (view->index->map->hdr.messages_count < + ctx->finish_min_msg_count) { + mail_index_set_error(view->index, + "Index %s lost messages without expunging " + "(%u -> %u)", view->index->filepath, + view->map->hdr.messages_count, + view->index->map->hdr.messages_count); + ctx->finish_min_msg_count = 0; + view->inconsistent = TRUE; + } + view->sync_new_map = view->index->map; view->sync_new_map->refcount++; - i_assert(view->index->map->hdr.messages_count >= - ctx->finish_min_msg_count); /* keep the old mapping without expunges until we're fully synced */