From: Timo Sirainen Date: Mon, 25 Dec 2017 19:31:05 +0000 (+0200) Subject: lib-imap-client: Add asserts for reconnect_command_count X-Git-Tag: 2.3.9~2512 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2c50587ddb4594b92586960505e627fa62adaef;p=thirdparty%2Fdovecot%2Fcore.git lib-imap-client: Add asserts for reconnect_command_count --- diff --git a/src/lib-imap-client/imapc-connection.c b/src/lib-imap-client/imapc-connection.c index 2be6fc85c8..c4be401fd2 100644 --- a/src/lib-imap-client/imapc-connection.c +++ b/src/lib-imap-client/imapc-connection.c @@ -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 */