dovecot-2.2: imap proxy: Set proxy_state correctly also with pro...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jan 7 21:33:47 EET 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/a0e04a5aadab
changeset: 17089:a0e04a5aadab
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jan 07 14:33:29 2014 -0500
description:
imap proxy: Set proxy_state correctly also with proxy_nopipelining.

diffstat:

 src/imap-login/imap-proxy.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (37 lines):

diff -r 6b8ae0ba5959 -r a0e04a5aadab src/imap-login/imap-proxy.c
--- a/src/imap-login/imap-proxy.c	Mon Dec 23 15:30:31 2013 +0200
+++ b/src/imap-login/imap-proxy.c	Tue Jan 07 14:33:29 2014 -0500
@@ -276,14 +276,6 @@
 		}
 		o_stream_nsend(output, str_data(str), str_len(str));
 		return 1;
-	} else if (strncmp(line, "C OK ", 5) == 0 &&
-		   client->proxy_password != NULL) {
-		/* pipelining was disabled, send the login now. */
-		str = t_str_new(128);
-		if (proxy_write_login(imap_client, str) < 0)
-			return -1;
-		o_stream_nsend(output, str_data(str), str_len(str));
-		return 1;
 	} else if (strncmp(line, "L OK ", 5) == 0) {
 		/* Login successful. Send this line to client. */
 		client->proxy_state = IMAP_PROXY_STATE_LOGIN;
@@ -339,8 +331,17 @@
 		imap_client->proxy_backend_capability = i_strdup(line + 13);
 		return 0;
 	} else if (strncmp(line, "C ", 2) == 0) {
-		/* Reply to CAPABILITY command we sent, ignore it */
+		/* Reply to CAPABILITY command we sent */
 		client->proxy_state = IMAP_PROXY_STATE_CAPABILITY;
+		if (strncmp(line, "C OK ", 5) == 0 &&
+		    client->proxy_password != NULL) {
+			/* pipelining was disabled, send the login now. */
+			str = t_str_new(128);
+			if (proxy_write_login(imap_client, str) < 0)
+				return -1;
+			o_stream_nsend(output, str_data(str), str_len(str));
+			return 1;
+		}
 		return 0;
 	} else if (strncasecmp(line, "I ", 2) == 0 ||
 		   strncasecmp(line, "* ID ", 5) == 0) {


More information about the dovecot-cvs mailing list