From: Timo Sirainen Date: Wed, 8 Nov 2017 12:06:00 +0000 (+0200) Subject: doveadm-server: Fix protocol handshake order X-Git-Tag: 2.2.34~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2b4e5f3d0067cd58c113b33e9ea053eade3e695;p=thirdparty%2Fdovecot%2Fcore.git 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 --- diff --git a/src/doveadm/client-connection.c b/src/doveadm/client-connection.c index 5c1d898316..7125436ba8 100644 --- a/src/doveadm/client-connection.c +++ b/src/doveadm/client-connection.c @@ -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 @@ static void client_connection_input(struct client_connection *conn) 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 @@ client_connection_create(int fd, int listen_fd, bool ssl) } conn->preauthenticated = client_connection_is_preauthenticated(listen_fd); - client_connection_send_auth_handshake(conn); client_connection_set_proctitle(conn, "");