]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Send the success reply in one write. Based on patch by Onno Molenkamp.
authorTimo Sirainen <tss@iki.fi>
Thu, 24 Apr 2008 13:08:25 +0000 (16:08 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 24 Apr 2008 13:08:25 +0000 (16:08 +0300)
--HG--
branch : HEAD

src/imap-login/imap-proxy.c
src/pop3-login/pop3-proxy.c

index e6b0b63fa76ef11d550865ca552f86cd3d59ca18..9d212eb9061c24f78513d21f6d90b4f19aa60530 100644 (file)
@@ -46,9 +46,12 @@ static int proxy_input_line(struct imap_client *client,
                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,
index 8ca9dcba0669deb0de7b240cf3a93c1a45694b07..7a7a25e1fe64ee6f50db542a6a2d55c6c9774994 100644 (file)
@@ -99,8 +99,8 @@ static void proxy_input(struct istream *input, struct ostream *output,
                        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,