comparison src/imap/imap-client.c @ 22984:d62b238d7d66

imap: Fix command ambiguity checking with special plugins If the tagged line is already sent, that command can't result in ambiguity anymore. A cleaner fix would be to add a new _WAIT_SYNC_OUTPUT state, but that requires all the existing code to understand that new state correctly, so it has a higher chance of breaking something. So at least for now don't add it.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 06 Aug 2018 12:39:25 +0300
parents 334fc7c1e9ee
children
comparison
equal deleted inserted replaced
22983:f2f813d047c8 22984:d62b238d7d66
770 { 770 {
771 struct client_command_context *cmd; 771 struct client_command_context *cmd;
772 772
773 cmd = new_cmd->client->command_queue; 773 cmd = new_cmd->client->command_queue;
774 for (; cmd != NULL; cmd = cmd->next) { 774 for (; cmd != NULL; cmd = cmd->next) {
775 if (cmd->state <= max_state && 775 /* The tagline_sent check is a bit kludgy here. Plugins may
776 hook into sync_notify_more() and send the tagline before
777 finishing the command. During this stage the state was been
778 dropped from _WAIT_SYNC to _WAIT_OUTPUT, so the <= max_state
779 check doesn't work correctly here. (Perhaps we should add
780 a new _WAIT_SYNC_OUTPUT?) */
781 if (cmd->state <= max_state && !cmd->tagline_sent &&
776 cmd != new_cmd && (cmd->cmd_flags & flags) != 0) 782 cmd != new_cmd && (cmd->cmd_flags & flags) != 0)
777 return cmd; 783 return cmd;
778 } 784 }
779 return NULL; 785 return NULL;
780 } 786 }