]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Finish all commands before starting IDLE.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 25 Jan 2016 15:37:02 +0000 (17:37 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 25 Jan 2016 15:39:19 +0000 (17:39 +0200)
We don't want to send tagged command replies only after the DONE. Also this
fixes assert-crash:

Panic: file imap-client.c: line 852 (client_check_command_hangs): assertion
failed: (!have_wait_unfinished || unfinished_count > 0)

Which could be reproduced by:

printf "0 SELECT INBOX\n1 NOOP\n2 IDLE\n"; read; printf "DONE\n"; read) | ./imap

src/imap/imap-commands.c

index f5679ba3a030e338287cc439bbc972c827b4427d..613098aabc947a22f8152d4e178cb8f8ff787f0f 100644 (file)
@@ -54,7 +54,11 @@ static const struct command imap_ext_commands[] = {
        { "ENABLE",             cmd_enable,      0 },
        { "ID",                 cmd_id,          0 },
        { "IDLE",               cmd_idle,        COMMAND_FLAG_BREAKS_SEQS |
-                                                COMMAND_FLAG_REQUIRES_SYNC },
+                                                COMMAND_FLAG_REQUIRES_SYNC |
+                                                /* finish syncing and sending
+                                                   all tagged commands before
+                                                   IDLE is started */
+                                                COMMAND_FLAG_BREAKS_MAILBOX },
        { "GETMETADATA",        cmd_getmetadata, 0 },
        { "SETMETADATA",        cmd_setmetadata, 0 },
        { "NAMESPACE",          cmd_namespace,   0 },