]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Replace o_stream_nfinish() with o_stream_flush()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 27 Oct 2017 23:06:56 +0000 (02:06 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Mon, 30 Oct 2017 11:04:53 +0000 (13:04 +0200)
src/auth/auth-worker-client.c
src/lib-auth/auth-master.c
src/lib-fs/fs-api.h
src/lib-storage/index/dbox-common/dbox-file-fix.c
src/lib-storage/index/dbox-common/dbox-file.c
src/lib-storage/index/dbox-common/dbox-save.c
src/lib-storage/index/dbox-multi/mdbox-purge.c
src/lib-storage/index/mbox/mbox-save.c
src/lib/iostream-rawlog.c
src/lmtp/commands.c

index 4d07018a3d0b4a4f1a8becdaa0bd20773efbe14d..172b3816f0b4d78cc58a843c7bb7ae5a8109eb1c 100644 (file)
@@ -117,7 +117,7 @@ static void auth_worker_send_reply(struct auth_worker_client *client,
        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');
index b4f3a30e421ebcc6aec43c329a0a4a56aa631898..216e1c7f581103e53a6230f42f8d99ba18cca288 100644 (file)
@@ -406,7 +406,7 @@ static int auth_master_run_cmd_pre(struct auth_master_connection *conn,
        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);
index eaadcc8a8a92179ac6a6e0b6795ce74bb4f3dc64..6811961802ed98b63739138745cf5eabbdb4a08b 100644 (file)
@@ -274,7 +274,7 @@ int fs_write(struct fs_file *file, const void *data, size_t size);
    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
index f2684fcad59bdc4531ec0b8db074f101c780986b..6ed7904d28c1cf118abba79283befaf5e602410b 100644 (file)
@@ -243,7 +243,7 @@ stream_copy(struct dbox_file *file, struct ostream *output,
                        "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));
@@ -436,7 +436,7 @@ dbox_file_fix_write_stream(struct dbox_file *file, uoff_t start_offset,
                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;
index fa14f484329b243703e00bf537ce1c79331984f5..0b3aed167e2ce7fdcdfeff4fe01a33132b9850c8 100644 (file)
@@ -551,7 +551,7 @@ int dbox_file_append_flush(struct dbox_file_append_context *ctx)
            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;
        }
index 619a7aba7431532008a8288f2b2eda15ec921544..91424c8e2bd9ccce4fd1c778f79daec1f6035505 100644 (file)
@@ -104,7 +104,7 @@ void dbox_save_end(struct dbox_save_context *ctx)
                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,
index 1dd4244b76b140ce50146f459cf99bed6a055c9c..704d855f5a63bd66ec0c3aeaa380ce2b7c748071 100644 (file)
@@ -207,7 +207,7 @@ mdbox_purge_save_msg(struct mdbox_purge_context *ctx, struct dbox_file *file,
 
        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,
index ef1759dbbbd5ff3d86792d26517d3ee68193b048..3a13150c4840bc0d63a64a2fbdd4ecc23e1364e2 100644 (file)
@@ -659,7 +659,7 @@ int mbox_save_finish(struct mail_save_context *_ctx)
 
        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);
        }
 
@@ -681,7 +681,7 @@ int mbox_save_finish(struct mail_save_context *_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);
@@ -775,7 +775,7 @@ int mbox_transaction_save_commit_pre(struct mail_save_context *_ctx)
 
        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 &&
index e4e800c11a95a9e99158435e3f397573af3814b2..ea41a35e20a4ff7c8b556c3a266731953509a6da 100644 (file)
@@ -125,7 +125,7 @@ void iostream_rawlog_write(struct rawlog_iostream *rstream,
                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));
index 4ade60083e5aa15e2b0f890dd1cd9f8e809c85cd..45915293a726123d70e84bcc07d6f843e96af97a 100644 (file)
@@ -1256,7 +1256,7 @@ static int client_input_add_file(struct client *client,
        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;