if (worker_restart_request)
o_stream_nsend_str(client->output, "RESTART\n");
o_stream_nsend(client->output, str_data(str), str_len(str));
- if (o_stream_nfinish(client->output) < 0 && request != NULL &&
+ if (o_stream_flush(client->output) < 0 && request != NULL &&
cmd_duration > AUTH_WORKER_WARN_DISCONNECTED_LONG_CMD_SECS) {
p = i_strchr_to_next(str_c(str), '\t');
p = p == NULL ? "BUG" : t_strcut(p, '\t');
o_stream_nsend_str(conn->output, cmd);
o_stream_uncork(conn->output);
- if (o_stream_nfinish(conn->output) < 0) {
+ if (o_stream_flush(conn->output) < 0) {
i_error("write(auth socket) failed: %s",
o_stream_get_error(conn->output));
auth_master_unset_io(conn);
fs_write_stream_finish/abort. The returned ostream is already corked and
it doesn't need to be uncorked. */
struct ostream *fs_write_stream(struct fs_file *file);
-/* Finish writing via stream, calling also o_stream_nfinish() on the stream and
+/* Finish writing via stream, calling also o_stream_flush() on the stream and
handling any pending errors. The file will be created/replaced/appended only
after this call, same as with fs_write(). Anything written to the stream
won't be visible earlier. Returns 1 if ok, 0 if async write isn't finished
"read(%s) failed: %s", file->cur_path,
i_stream_get_error(input));
ret = -1;
- } else if (o_stream_nfinish(output) < 0) {
+ } else if (o_stream_flush(output) < 0) {
mail_storage_set_critical(&file->storage->storage,
"write(%s) failed: %s", out_path,
o_stream_get_error(output));
if (output->stream_errno != 0)
break;
}
- if (o_stream_nfinish(output) < 0) {
+ if (o_stream_flush(output) < 0) {
mail_storage_set_critical(&file->storage->storage,
"write(%s) failed: %s", temp_path, o_stream_get_error(output));
ret = -1;
ctx->last_checkpoint_offset == ctx->output->offset)
return 0;
- if (o_stream_nfinish(ctx->output) < 0) {
+ if (o_stream_flush(ctx->output) < 0) {
dbox_file_set_syscall_error(ctx->file, "write()");
return -1;
}
ret = o_stream_finish(mdata->output);
} else {
/* no plugins - flush the output so far */
- ret = o_stream_nfinish(mdata->output);
+ ret = o_stream_flush(mdata->output);
}
if (ret < 0) {
mail_storage_set_critical(ctx->ctx.transaction->box->storage,
input = i_stream_create_limit(file->input, msg_size);
o_stream_nsend_istream(output, input);
- if (o_stream_nfinish(output) < 0) {
+ if (o_stream_flush(output) < 0) {
mail_storage_set_critical(&file->storage->storage,
"write(%s) failed: %s",
out_file_append->file->cur_path,
if (ctx->output != NULL) {
/* make sure everything is written */
- if (o_stream_nfinish(ctx->output) < 0)
+ if (o_stream_flush(ctx->output) < 0)
write_error(ctx);
}
if (ctx->failed && ctx->mail_offset != (uoff_t)-1) {
/* saving this mail failed - truncate back to beginning of it */
- (void)o_stream_nfinish(ctx->output);
+ (void)o_stream_flush(ctx->output);
if (ftruncate(ctx->mbox->mbox_fd, (off_t)ctx->mail_offset) < 0)
mbox_set_syscall_error(ctx->mbox, "ftruncate()");
(void)o_stream_seek(ctx->output, ctx->mail_offset);
if (ctx->output != NULL) {
/* flush the final LF */
- if (o_stream_nfinish(ctx->output) < 0)
+ if (o_stream_flush(ctx->output) < 0)
write_error(ctx);
}
if (mbox->mbox_fd != -1 && !mbox->mbox_writeonly &&
iostream_rawlog_write_unbuffered(rstream, data, size);
o_stream_uncork(rstream->rawlog_output);
- if (o_stream_nfinish(rstream->rawlog_output) < 0) {
+ if (o_stream_flush(rstream->rawlog_output) < 0) {
i_error("write(%s) failed: %s",
o_stream_get_name(rstream->rawlog_output),
o_stream_get_error(rstream->rawlog_output));
o_stream_nsend(state->mail_data_output,
state->mail_data->data, state->mail_data->used);
o_stream_nsend(client->state.mail_data_output, data, size);
- if (o_stream_nfinish(client->state.mail_data_output) < 0) {
+ if (o_stream_flush(client->state.mail_data_output) < 0) {
i_error("write(%s) failed: %s", str_c(path),
o_stream_get_error(client->state.mail_data_output));
return -1;