]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fix pipelining commands with SEARCH
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Jun 2017 20:20:12 +0000 (23:20 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Jun 2017 20:22:04 +0000 (23:22 +0300)
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.

src/imap/imap-search.c

index b0da519302edc8fac05a2681881b3635e94d6f6e..f895ca12e7146cff0f70085df08a84ae8483f819 100644 (file)
@@ -602,11 +602,10 @@ bool imap_search_start(struct imap_search_context *ctx,
                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;
 }