changeset 22754:209a63ed9de1

lib-imap-client: Add asserts for reconnect_command_count
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 25 Dec 2017 21:31:05 +0200
parents 6e59f4b282a8
children 59ac434fef3f
files src/lib-imap-client/imapc-connection.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-imap-client/imapc-connection.c	Mon Dec 25 21:29:06 2017 +0200
+++ b/src/lib-imap-client/imapc-connection.c	Mon Dec 25 21:31:05 2017 +0200
@@ -1454,6 +1454,7 @@
 
 	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 @@
 
 	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 */