Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5592:29ac17ec78ff HEAD
Crashfix when saving mails
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 11 May 2007 21:57:52 +0300 |
parents | cf45e0fdcf52 |
children | f8dc0bdb06a7 |
files | src/lib-storage/index/mbox/mbox-save.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-save.c Fri May 11 20:31:50 2007 +0300 +++ b/src/lib-storage/index/mbox/mbox-save.c Fri May 11 21:57:52 2007 +0300 @@ -40,7 +40,7 @@ string_t *headers; size_t space_end_idx; - uint32_t seq, next_uid, uid_validity; + uint32_t seq, next_uid, uid_validity, first_saved_uid; struct istream *input; struct ostream *output, *body_output; @@ -197,12 +197,11 @@ hdr = mail_index_get_header(view); ctx->next_uid = hdr->next_uid; + ctx->first_saved_uid = ctx->next_uid; ctx->uid_validity = hdr->uid_validity; ctx->synced = TRUE; t->mbox_modified = TRUE; - *t->ictx.first_saved_uid = ctx->next_uid; - mail_index_view_close(&view); } @@ -651,6 +650,8 @@ i_assert(ctx->finished); if (ctx->synced) { + *t->ictx.first_saved_uid = ctx->first_saved_uid; + mail_index_update_header(ctx->trans, offsetof(struct mail_index_header, next_uid), &ctx->next_uid, sizeof(ctx->next_uid), FALSE);