changeset 22239:2c443082031c

imap: Fix pipelining commands with SEARCH If the SEARCH wasn't a long-running one, it ends with going to sync. The command state shouldn't then be changed to _WAIT_EXTERNAL.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 12 Jun 2017 23:20:12 +0300
parents 1378799de216
children 9e0fdc2a683e
files src/imap/imap-search.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-search.c	Wed Jun 14 10:44:36 2017 +0300
+++ b/src/imap/imap-search.c	Mon Jun 12 23:20:12 2017 +0300
@@ -602,11 +602,10 @@
 		return TRUE;
 
 	/* we may have moved onto syncing by now */
-	if (cmd->func == cmd_search_more)
+	if (cmd->func == cmd_search_more) {
 		ctx->to = timeout_add(0, cmd_search_more_callback, cmd);
-
-	cmd->state = CLIENT_COMMAND_STATE_WAIT_EXTERNAL;
-
+		cmd->state = CLIENT_COMMAND_STATE_WAIT_EXTERNAL;
+	}
 	return FALSE;
 }