Skip to content

Commit

Permalink
imap: Fix command ambiguity checking with special plugins
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen authored and cmouse committed Aug 16, 2018
1 parent 44282ae commit 2e6a374
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/imap/imap-client.c
Expand Up @@ -785,7 +785,13 @@ client_command_find_with_flags(struct client_command_context *new_cmd,

cmd = new_cmd->client->command_queue;
for (; cmd != NULL; cmd = cmd->next) {
if (cmd->state <= max_state &&
/* The tagline_sent check is a bit kludgy here. Plugins may
hook into sync_notify_more() and send the tagline before
finishing the command. During this stage the state was been
dropped from _WAIT_SYNC to _WAIT_OUTPUT, so the <= max_state
check doesn't work correctly here. (Perhaps we should add
a new _WAIT_SYNC_OUTPUT?) */
if (cmd->state <= max_state && !cmd->tagline_sent &&
cmd != new_cmd && (cmd->cmd_flags & flags) != 0)
return cmd;
}
Expand Down

0 comments on commit 2e6a374

Please sign in to comment.