]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: client - Read any pipelined replies after authentication reply
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 8 Nov 2017 12:20:49 +0000 (14:20 +0200)
committerTimo Sirainen <tss@dovecot.fi>
Wed, 15 Nov 2017 20:24:08 +0000 (22:24 +0200)
This practically shouldn't happen.

src/doveadm/server-connection.c

index 59eff5e324010806b7002c7467f015fec26ec812..54c6c425ba0a1e7c8e13834cb5ae1234d40fd174 100644 (file)
@@ -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)) ;