Mercurial > dovecot > core-2.2
changeset 4234:c31d7c833d5c HEAD
Error fixes
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 27 Apr 2006 16:36:24 +0300 |
parents | dd22380b0fc0 |
children | 304e4e4410b9 |
files | src/lib-storage/index/dbox/dbox-mail.c src/lib-storage/index/dbox/dbox-sync.c |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-mail.c Thu Apr 27 15:44:19 2006 +0300 +++ b/src/lib-storage/index/dbox/dbox-mail.c Thu Apr 27 16:36:24 2006 +0300 @@ -63,7 +63,7 @@ mail_storage_set_critical(STORAGE(mbox->storage), "Cached message offset lost for seq %u in " - "dbox file %s", seq, mbox->path); + "dbox %s", seq, mbox->path); /* resync and try again */ if (dbox_sync(mbox, TRUE) < 0) @@ -115,7 +115,7 @@ mail_storage_set_critical(STORAGE(mbox->storage), "Cached message offset (%u, %"PRIuUOFF_T") " - "broken for uid %u in dbox file %s", + "broken for uid %u in dbox %s", file_seq, offset, mail->mail.mail.uid, mbox->path); return -1;
--- a/src/lib-storage/index/dbox/dbox-sync.c Thu Apr 27 15:44:19 2006 +0300 +++ b/src/lib-storage/index/dbox/dbox-sync.c Thu Apr 27 16:36:24 2006 +0300 @@ -45,6 +45,13 @@ if (dbox_sync_get_file_offset(ctx, seq, &file_seq, &offset) < 0) return -1; + if (file_seq == 0) { + mail_storage_set_critical(STORAGE(ctx->mbox->storage), + "Cached message offset lost for seq %u in " + "dbox %s", seq, ctx->mbox->path); + return -1; + } + file_seqs = array_get(&ctx->added_file_seqs, &count); for (i = 0; i < count; i++) { if (file_seqs[i] == file_seq) {