changeset 22749:7c10968dc541

doveadm-server: Fix protocol handshake order With version 1.1 protocol, server sent the authentication "+" or "-" line before the VERSION. doveadm client accepts the VERSION reply either before or after, so this change doesn't break it. It makes the protocol cleaner though. Based on patch by Manuel Mausz
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Wed, 08 Nov 2017 14:06:00 +0200
parents 597c668f887a
children 954aab30f28e
files src/doveadm/client-connection.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/client-connection.c	Wed Nov 08 14:04:12 2017 +0200
+++ b/src/doveadm/client-connection.c	Wed Nov 08 14:06:00 2017 +0200
@@ -28,6 +28,8 @@
 #define MAX_INBUF_SIZE (1024*1024)
 
 static void client_connection_input(struct client_connection *conn);
+static void
+client_connection_send_auth_handshake(struct client_connection *conn);
 
 static failure_callback_t *orig_error_callback, *orig_fatal_callback;
 static failure_callback_t *orig_info_callback, *orig_debug_callback = NULL;
@@ -505,6 +507,7 @@
 					   DOVEADM_CLIENT_PROTOCOL_VERSION_LINE"\n");
 			conn->use_multiplex = TRUE;
 		}
+		client_connection_send_auth_handshake(conn);
 		conn->handshaked = TRUE;
 	}
 	if (!conn->authenticated) {
@@ -672,7 +675,6 @@
 	}
 	conn->preauthenticated =
 		client_connection_is_preauthenticated(listen_fd);
-	client_connection_send_auth_handshake(conn);
 
 	client_connection_set_proctitle(conn, "");