/* updated for each appended mail: */
uint32_t seq;
struct istream *input;
- struct ostream *output;
struct mail *mail;
int fd;
path = cydir_get_save_path(ctx, ctx->mail_count);
ctx->fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0660);
if (ctx->fd != -1) {
- ctx->output =
+ _ctx->output =
o_stream_create_fd_file(ctx->fd, 0, FALSE);
- o_stream_cork(ctx->output);
+ o_stream_cork(_ctx->output);
} else {
mail_storage_set_critical(trans->box->storage,
"open(%s) failed: %m", path);
return -1;
do {
- if (o_stream_send_istream(ctx->output, ctx->input) < 0) {
+ if (o_stream_send_istream(_ctx->output, ctx->input) < 0) {
if (!mail_storage_set_error_from_errno(storage)) {
mail_storage_set_critical(storage,
"o_stream_send_istream(%s) failed: %m",
ctx->finished = TRUE;
- if (o_stream_flush(ctx->output) < 0) {
+ if (o_stream_flush(_ctx->output) < 0) {
mail_storage_set_critical(storage,
"o_stream_flush(%s) failed: %m", path);
ctx->failed = TRUE;
}
}
- o_stream_destroy(&ctx->output);
+ o_stream_destroy(&_ctx->output);
if (close(ctx->fd) < 0) {
mail_storage_set_critical(storage,
"close(%s) failed: %m", path);
ARRAY_TYPE(keyword_indexes) keywords_array;
struct istream *input;
- struct ostream *output;
int fd;
uint32_t first_seq, seq;
} T_END;
if (!ctx->failed) {
- ctx->output = o_stream_create_fd_file(ctx->fd, 0, FALSE);
- o_stream_cork(ctx->output);
+ _ctx->output = o_stream_create_fd_file(ctx->fd, 0, FALSE);
+ o_stream_cork(_ctx->output);
}
return ctx->failed ? -1 : 0;
}
return -1;
do {
- if (o_stream_send_istream(ctx->output, ctx->input) < 0) {
+ if (o_stream_send_istream(_ctx->output, ctx->input) < 0) {
if (!mail_storage_set_error_from_errno(storage)) {
mail_storage_set_critical(storage,
"o_stream_send_istream(%s/%s) "
}
path = t_strconcat(ctx->tmpdir, "/", ctx->file_last->basename, NULL);
- if (o_stream_flush(ctx->output) < 0) {
+ if (o_stream_flush(_ctx->output) < 0) {
if (!mail_storage_set_error_from_errno(storage)) {
mail_storage_set_critical(storage,
"o_stream_flush(%s) failed: %m", path);
i_stream_unref(&ctx->input);
/* remember the size in case we want to add it to filename */
- ctx->file_last->size = ctx->output->offset;
+ ctx->file_last->size = _ctx->output->offset;
if (ctx->cur_dest_mail == NULL ||
mail_get_virtual_size(ctx->cur_dest_mail,
&ctx->file_last->vsize) < 0)
ctx->file_last->vsize = (uoff_t)-1;
- output_errno = ctx->output->stream_errno;
- o_stream_destroy(&ctx->output);
+ output_errno = _ctx->output->stream_errno;
+ o_stream_destroy(&_ctx->output);
if (!ctx->mbox->ibox.fsync_disable && !ctx->failed) {
if (fsync(ctx->fd) < 0) {
bool newdir, new_changed, cur_changed;
int ret;
- i_assert(ctx->output == NULL);
+ i_assert(ctx->ctx.output == NULL);
i_assert(ctx->finished);
sync_flags = MAILDIR_UIDLIST_SYNC_PARTIAL |
size_t dir_len;
bool hardlinks = FALSE;
- i_assert(ctx->output == NULL);
+ i_assert(ctx->ctx.output == NULL);
if (!ctx->finished)
maildir_save_cancel(&ctx->ctx);