]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-client: Add asserts for reconnect_command_count
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 25 Dec 2017 19:31:05 +0000 (21:31 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 18 Jan 2018 07:12:30 +0000 (09:12 +0200)
src/lib-imap-client/imapc-connection.c

index 2be6fc85c8f59debc23b7cec4a9481895af51d1a..c4be401fd2b52e21abcaafeeb3b2c266d1f8aee8 100644 (file)
@@ -1464,6 +1464,7 @@ static int imapc_connection_input_tagged(struct imapc_connection *conn)
 
        if (conn->reconnect_command_count > 0 &&
            (cmd->flags & IMAPC_COMMAND_FLAG_RECONNECTED) != 0) {
+               i_assert(conn->reconnect_command_count > 0);
                if (--conn->reconnect_command_count == 0) {
                        /* we've received replies for all the commands started
                           before reconnection. if we get disconnected now, we
@@ -2244,6 +2245,8 @@ static void imapc_connection_cmd_send(struct imapc_command *cmd)
 
        imapc_connection_send_idle_done(conn);
 
+       i_assert((cmd->flags & IMAPC_COMMAND_FLAG_RECONNECTED) == 0);
+
        if ((cmd->flags & IMAPC_COMMAND_FLAG_PRELOGIN) != 0 &&
            conn->state == IMAPC_CONNECTION_STATE_AUTHENTICATING) {
                /* pre-login commands get inserted before everything else */