changeset 6935:38fd7447172d HEAD

Minor optimization.
author Timo Sirainen <tss@iki.fi>
date Wed, 05 Dec 2007 17:19:57 +0200
parents f6118fc9c23e
children aacc69cc267b
files src/auth/auth-client-connection.c
diffstat 1 files changed, 11 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-client-connection.c	Wed Dec 05 17:09:07 2007 +0200
+++ b/src/auth/auth-client-connection.c	Wed Dec 05 17:19:57 2007 +0200
@@ -41,19 +41,13 @@
 static void auth_client_send(struct auth_client_connection *conn,
 			     const char *cmd)
 {
-	string_t *str;
-
-	t_push();
-	str = t_str_new(256);
-	str_append(str, cmd);
-	str_append_c(str, '\n');
+	struct const_iovec iov[2];
 
-	if (conn->auth->verbose_debug) {
-		i_info("client out: %s", conn->auth->verbose_debug_passwords ?
-		       cmd : reply_line_hide_pass(cmd));
-	}
-
-	(void)o_stream_send(conn->output, str_data(str), str_len(str));
+	iov[0].iov_base = cmd;
+	iov[0].iov_len = strlen(cmd);
+	iov[1].iov_base = "\n";
+	iov[1].iov_len = 1;
+	(void)o_stream_sendv(conn->output, iov, 2);
 
 	if (o_stream_get_buffer_used_size(conn->output) >=
 	    OUTBUF_THROTTLE_SIZE) {
@@ -62,7 +56,11 @@
 		if (conn->io != NULL)
 			io_remove(&conn->io);
 	}
-	t_pop();
+
+	if (conn->auth->verbose_debug) {
+		i_info("client out: %s", conn->auth->verbose_debug_passwords ?
+		       cmd : reply_line_hide_pass(cmd));
+	}
 }
 
 static void auth_callback(const char *reply,