]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: client - Cleanup: Don't check authenticate_sent twice
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 8 Nov 2017 12:32:25 +0000 (14:32 +0200)
committerTimo Sirainen <tss@dovecot.fi>
Wed, 15 Nov 2017 20:24:08 +0000 (22:24 +0200)
src/doveadm/server-connection.c

index 54c6c425ba0a1e7c8e13834cb5ae1234d40fd174..90d01c3d7b93f8222551cb6ebec9ee712a52f0c4 100644 (file)
@@ -376,16 +376,16 @@ static void server_connection_input(struct server_connection *conn)
                                server_connection_authenticated(conn);
                                break;
                        } else if (strcmp(line, "-") == 0) {
-                               if (!conn->authenticate_sent &&
-                                   server_connection_authenticate(conn) < 0) {
-                                       server_connection_destroy(&conn);
-                                       return;
-                               } else if (conn->authenticate_sent) {
+                               if (conn->authenticate_sent) {
                                        i_error("doveadm authentication failed (%s)",
                                                line+1);
                                        server_connection_destroy(&conn);
                                        return;
                                }
+                               if (server_connection_authenticate(conn) < 0) {
+                                       server_connection_destroy(&conn);
+                                       return;
+                               }
                        } else {
                                i_error("doveadm server sent invalid handshake: %s",
                                        line);