Mercurial > dovecot > core-2.2
changeset 15292:8c06fe0b280d
dbox: Small code cleanup.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 03 Oct 2012 01:12:13 +0300 |
parents | 3ce50c0bb782 |
children | 4c3dac1a94cf |
files | src/lib-storage/index/dbox-common/dbox-save.c src/lib-storage/index/dbox-multi/mdbox-save.c src/lib-storage/index/dbox-single/sdbox-save.c |
diffstat | 3 files changed, 9 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-common/dbox-save.c Tue Oct 02 23:24:10 2012 +0300 +++ b/src/lib-storage/index/dbox-common/dbox-save.c Wed Oct 03 01:12:13 2012 +0300 @@ -105,13 +105,14 @@ if (index_attachment_save_finish(&ctx->ctx) < 0) ctx->failed = TRUE; } - if (ctx->ctx.output == dbox_output) - return; - - /* e.g. zlib plugin had changed this */ - o_stream_ref(dbox_output); - o_stream_destroy(&ctx->ctx.output); - ctx->ctx.output = dbox_output; + if (ctx->ctx.output != dbox_output) { + /* e.g. zlib plugin had changed this */ + o_stream_ref(dbox_output); + o_stream_destroy(&ctx->ctx.output); + ctx->ctx.output = dbox_output; + } + index_mail_cache_parse_deinit(ctx->ctx.dest_mail, + ctx->ctx.received_date, !ctx->failed); } void dbox_save_write_metadata(struct mail_save_context *_ctx,
--- a/src/lib-storage/index/dbox-multi/mdbox-save.c Tue Oct 02 23:24:10 2012 +0300 +++ b/src/lib-storage/index/dbox-multi/mdbox-save.c Wed Oct 03 01:12:13 2012 +0300 @@ -199,8 +199,6 @@ return -1; dbox_save_end(&ctx->ctx); - index_mail_cache_parse_deinit(_ctx->dest_mail, - _ctx->received_date, !ctx->ctx.failed); mail = array_idx_modifiable(&ctx->mails, array_count(&ctx->mails) - 1); if (!ctx->ctx.failed) T_BEGIN {
--- a/src/lib-storage/index/dbox-single/sdbox-save.c Tue Oct 02 23:24:10 2012 +0300 +++ b/src/lib-storage/index/dbox-single/sdbox-save.c Wed Oct 03 01:12:13 2012 +0300 @@ -181,13 +181,9 @@ index_mail_cache_add(mail, MAIL_CACHE_SAVE_DATE, &t, sizeof(t)); } - - index_mail_cache_parse_deinit(_ctx->dest_mail, - _ctx->received_date, !ctx->ctx.failed); + dbox_save_end(&ctx->ctx); files = array_idx_modifiable(&ctx->files, array_count(&ctx->files) - 1); - - dbox_save_end(&ctx->ctx); if (!ctx->ctx.failed) T_BEGIN { if (dbox_save_mail_write_metadata(&ctx->ctx, *files) < 0) ctx->ctx.failed = TRUE;