From: Martti Rannanjärvi Date: Tue, 20 Dec 2016 11:34:43 +0000 (+0200) Subject: imap: use o_stream_nsend when not checking failure X-Git-Tag: 2.3.0.rc1~2381 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d0e6c57cf45ad517748cfbb5f3aa3b53e42e3d0;p=thirdparty%2Fdovecot%2Fcore.git imap: use o_stream_nsend when not checking failure --- diff --git a/src/imap/cmd-getmetadata.c b/src/imap/cmd-getmetadata.c index eb350e12c0..4381d40c6c 100644 --- a/src/imap/cmd-getmetadata.c +++ b/src/imap/cmd-getmetadata.c @@ -143,7 +143,7 @@ cmd_getmetadata_send_nil_reply(struct imap_getmetadata_context *ctx, we must return it as NIL. */ str = metadata_add_entry(ctx, entry); str_append(str, " NIL"); - o_stream_send(ctx->cmd->client->output, str_data(str), str_len(str)); + o_stream_nsend(ctx->cmd->client->output, str_data(str), str_len(str)); } static void cmd_getmetadata_send_entry(struct imap_getmetadata_context *ctx, diff --git a/src/imap/cmd-thread.c b/src/imap/cmd-thread.c index 7268d6c86c..065fe9e529 100644 --- a/src/imap/cmd-thread.c +++ b/src/imap/cmd-thread.c @@ -133,7 +133,7 @@ imap_orderedsubject_thread_write(struct ostream *output, string_t *reply, unsigned int i, count; if (str_len(reply) > 128-10) { - o_stream_send(output, str_data(reply), str_len(reply)); + o_stream_nsend(output, str_data(reply), str_len(reply)); str_truncate(reply, 0); } @@ -150,8 +150,8 @@ imap_orderedsubject_thread_write(struct ostream *output, string_t *reply, str_printfa(reply, "(%u ", msgs[0]); for (i = 1; i < count; i++) { if (str_len(reply) > 128-10) { - o_stream_send(output, str_data(reply), - str_len(reply)); + o_stream_nsend(output, str_data(reply), + str_len(reply)); str_truncate(reply, 0); } str_printfa(reply, "(%u)", msgs[i]); @@ -239,7 +239,7 @@ static int imap_thread_orderedsubject(struct client_command_context *cmd, reply, thread); } str_append(reply, "\r\n"); - o_stream_send(cmd->client->output, str_data(reply), str_len(reply)); + o_stream_nsend(cmd->client->output, str_data(reply), str_len(reply)); array_free(&threads); pool_unref(&pool); diff --git a/src/imap/imap-master-client.c b/src/imap/imap-master-client.c index 17bb53e14d..e0a08da1fe 100644 --- a/src/imap/imap-master-client.c +++ b/src/imap/imap-master-client.c @@ -201,14 +201,14 @@ imap_master_client_input_args(struct connection *conn, const char *const *args, if (imap_master_client_parse_input(args, pool, &input, &master_input, &error) < 0) { i_error("imap-master: Failed to parse client input: %s", error); - o_stream_send_str(conn->output, t_strdup_printf( + o_stream_nsend_str(conn->output, t_strdup_printf( "-Failed to parse client input: %s\n", error)); i_close_fd(&fd_client); return -1; } if (imap_master_client_verify(&master_input, fd_client, &error) < 0) { i_error("imap-master: Failed to verify client input: %s", error); - o_stream_send_str(conn->output, t_strdup_printf( + o_stream_nsend_str(conn->output, t_strdup_printf( "-Failed to verify client input: %s\n", error)); i_close_fd(&fd_client); return -1; @@ -216,7 +216,7 @@ imap_master_client_input_args(struct connection *conn, const char *const *args, /* Send a success notification before we start anything that lasts potentially a long time. imap-hibernate process is waiting for us to answer. Even if we fail later, we log the error anyway. */ - o_stream_send_str(conn->output, "+\n"); + o_stream_nsend_str(conn->output, "+\n"); /* NOTE: before client_create_from_input() on failures we need to close fd_client, but afterward it gets closed by client_destroy() */