changeset 21290:b272b85948e6

imap: Fix assert when waiting for input on SEARCH/SORT Set cmd->state to CLIENT_COMMAND_STATE_WAIT_EXTERNAL because we are not expecting input or output. Fixes Panic: file imap-client.c: line 854 (client_check_command_hangs): assertion failed: (client->io != NULL || (client->output_cmd_lock != NULL && client->output_cmd_lock != client->input_lock))
author Aki Tuomi <aki.tuomi@dovecot.fi>
date Mon, 12 Dec 2016 15:14:52 +0200
parents 08eec0b1aae6
children f07aa4c27bed
files src/imap/imap-search.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-search.c	Mon Dec 12 12:37:34 2016 +0200
+++ b/src/imap/imap-search.c	Mon Dec 12 15:14:52 2016 +0200
@@ -603,6 +603,9 @@
 	/* we may have moved onto syncing by now */
 	if (cmd->func == cmd_search_more)
 		ctx->to = timeout_add(0, cmd_search_more_callback, cmd);
+
+	cmd->state = CLIENT_COMMAND_STATE_WAIT_EXTERNAL;
+
 	return FALSE;
 }