changeset 21350:c848870c9cd1

imap: use o_stream_nsend when not checking failure
author Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
date Tue, 20 Dec 2016 13:34:43 +0200
parents 5a5186b552e6
children 10034ed9ee46
files src/imap/cmd-getmetadata.c src/imap/cmd-thread.c src/imap/imap-master-client.c
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-getmetadata.c	Tue Dec 20 10:03:40 2016 +0200
+++ b/src/imap/cmd-getmetadata.c	Tue Dec 20 13:34:43 2016 +0200
@@ -143,7 +143,7 @@
 	   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,
--- a/src/imap/cmd-thread.c	Tue Dec 20 10:03:40 2016 +0200
+++ b/src/imap/cmd-thread.c	Tue Dec 20 13:34:43 2016 +0200
@@ -133,7 +133,7 @@
 	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 @@
 		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 @@
 						 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);
--- a/src/imap/imap-master-client.c	Tue Dec 20 10:03:40 2016 +0200
+++ b/src/imap/imap-master-client.c	Tue Dec 20 13:34:43 2016 +0200
@@ -201,14 +201,14 @@
 	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 @@
 	/* 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() */