]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: use o_stream_nsend when not checking failure
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Tue, 20 Dec 2016 11:34:43 +0000 (13:34 +0200)
committerGitLab <gitlab@git.dovecot.net>
Fri, 23 Dec 2016 13:29:32 +0000 (15:29 +0200)
src/imap/cmd-getmetadata.c
src/imap/cmd-thread.c
src/imap/imap-master-client.c

index eb350e12c09364d8f2555445f6dcf07c9d3e71b0..4381d40c6cdde965c939d95bf8b5e84c75bd5474 100644 (file)
@@ -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,
index 7268d6c86cdd6d5651ff4cdfb7b0e7b866c1f868..065fe9e529db9e18428f4cbd14d2584c7a58c98d 100644 (file)
@@ -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);
index 17bb53e14d3292b0df7dd01ba3d517364f5c661d..e0a08da1febc5bce42d78fdf0d26039aac4c739e 100644 (file)
@@ -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() */