From b52b16e9b2064e1fe047e1af0df29356bedca3a3 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 8 Nov 2017 14:20:49 +0200 Subject: [PATCH] doveadm: client - Read any pipelined replies after authentication reply This practically shouldn't happen. --- src/doveadm/server-connection.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/doveadm/server-connection.c b/src/doveadm/server-connection.c index 59eff5e324..54c6c425ba 100644 --- a/src/doveadm/server-connection.c +++ b/src/doveadm/server-connection.c @@ -352,8 +352,8 @@ static void server_connection_input(struct server_connection *conn) return; } - if (!conn->authenticated) { - while((line = i_stream_next_line(conn->input)) != NULL) { + while (!conn->authenticated) { + if ((line = i_stream_next_line(conn->input)) != NULL) { /* Allow VERSION before or after the "+" or "-" line, because v2.2.33 sent the version after and newer versions send before. */ @@ -393,15 +393,13 @@ static void server_connection_input(struct server_connection *conn) return; } conn->authenticate_sent = TRUE; - } - - if (line == NULL) { + } else { if (conn->input->eof || conn->input->stream_errno != 0) { server_log_disconnect_error(conn); server_connection_destroy(&conn); } + return; } - return; } while (server_connection_input_one(conn)) ; -- 2.47.3