Mercurial > dovecot > original-hg > dovecot-1.2
changeset 3513:4d3be62d9db9 HEAD
Error handling fix, more debugging and a new assert
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 23 Jul 2005 11:21:51 +0300 |
parents | 83c0a3e62722 |
children | 31b5b232c783 |
files | src/lib-storage/index/mbox/mbox-sync.c |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync.c Sat Jul 23 10:52:06 2005 +0300 +++ b/src/lib-storage/index/mbox/mbox-sync.c Sat Jul 23 11:21:51 2005 +0300 @@ -257,6 +257,7 @@ mail_storage_set_index_error(&sync_ctx->mbox->ibox); return -1; } + i_assert(ret != 0); /* we should be looking at head index */ if (uid <= rec->uid) break; @@ -267,18 +268,20 @@ rec = NULL; } - if (ret == 0 && uid < sync_ctx->idx_next_uid) { + if (rec == NULL && uid < sync_ctx->idx_next_uid) { /* this UID was already in index and it was expunged */ mail_storage_set_critical(STORAGE(sync_ctx->mbox->storage), "mbox sync: Expunged message reappeared in mailbox %s " - "(UID %u < %u)", sync_ctx->mbox->path, uid, - sync_ctx->idx_next_uid); + "(UID %u < %u, seq=%u, idx_msgs=%u)", + sync_ctx->mbox->path, uid, sync_ctx->idx_next_uid, + sync_ctx->seq, messages_count); ret = 0; rec = NULL; } else if (rec != NULL && rec->uid != uid) { /* new UID in the middle of the mailbox - shouldn't happen */ mail_storage_set_critical(STORAGE(sync_ctx->mbox->storage), "mbox sync: UID inserted in the middle of mailbox %s " - "(%u > %u)", sync_ctx->mbox->path, rec->uid, uid); + "(%u > %u, seq=%u, idx_msgs=%u)", sync_ctx->mbox->path, + rec->uid, uid, sync_ctx->seq, messages_count); ret = 0; rec = NULL; } else { ret = 1;