Skip to content

Commit

Permalink
lib-imap-client: Add asserts for reconnect_command_count
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and villesavolainen committed Jan 18, 2018
1 parent 5044de0 commit 1421648
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib-imap-client/imapc-connection.c
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 1421648

Please sign in to comment.