dovecot-1.1: Send the success reply in one write. Based on patch...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 24 16:08:33 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/053ec63146cb
changeset: 7454:053ec63146cb
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 24 16:08:25 2008 +0300
description:
Send the success reply in one write. Based on patch by Onno Molenkamp.

diffstat:

2 files changed, 7 insertions(+), 4 deletions(-)
src/imap-login/imap-proxy.c |    9 ++++++---
src/pop3-login/pop3-proxy.c |    2 +-

diffs (32 lines):

diff -r 3353ddd8ac9f -r 053ec63146cb src/imap-login/imap-proxy.c
--- a/src/imap-login/imap-proxy.c	Thu Apr 24 15:48:01 2008 +0300
+++ b/src/imap-login/imap-proxy.c	Thu Apr 24 16:08:25 2008 +0300
@@ -46,9 +46,12 @@ static int proxy_input_line(struct imap_
 		return 0;
 	} else if (strncmp(line, "P OK ", 5) == 0) {
 		/* Login successful. Send this line to client. */
-		(void)o_stream_send_str(client->output, client->cmd_tag);
-		(void)o_stream_send_str(client->output, line + 1);
-		(void)o_stream_send(client->output, "\r\n", 2);
+		str = t_str_new(128);
+		str_append(str, client->cmd_tag);
+		str_append(str, line + 1);
+		str_append(str, "\r\n");
+		(void)o_stream_send(client->output,
+				    str_data(str), str_len(str));
 
 		msg = t_strdup_printf("proxy(%s): started proxying to %s:%u",
 				      client->common.virtual_user,
diff -r 3353ddd8ac9f -r 053ec63146cb src/pop3-login/pop3-proxy.c
--- a/src/pop3-login/pop3-proxy.c	Thu Apr 24 15:48:01 2008 +0300
+++ b/src/pop3-login/pop3-proxy.c	Thu Apr 24 16:08:25 2008 +0300
@@ -99,8 +99,8 @@ static void proxy_input(struct istream *
 			break;
 
 		/* Login successful. Send this line to client. */
+		line = t_strconcat(line, "\r\n", NULL);
 		(void)o_stream_send_str(client->output, line);
-		(void)o_stream_send(client->output, "\r\n", 2);
 
 		msg = t_strdup_printf("proxy(%s): started proxying to %s:%u",
 				      client->common.virtual_user,


More information about the dovecot-cvs mailing list