]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Thu, 18 Jan 2018 10:06:10 +0000 (12:06 +0200)
src/lib-imap-client/imapc-connection.c

index 164d66618c260bf26db7e2358904e0b686ad60de..736476cd29f305ec053b2596e7ef297b7f65b3fe 100644 (file)
@@ -1454,6 +1454,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
@@ -2214,6 +2215,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 */