]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fixed hanging if a pipelined IMAP command was waiting for previous command...
authorTimo Sirainen <tss@iki.fi>
Tue, 24 Nov 2015 09:50:15 +0000 (11:50 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 24 Nov 2015 09:50:15 +0000 (11:50 +0200)
..And the previous command was waiting for the next command to finish before
it would start syncing. For example FETCH+LOGOUT pipelined.

src/imap/imap-client.c

index 33d2c7b145c08c843ac2cf02be1b16339fabc253..34b6e9ae1e75f841cae3dc7db510565db73907a5 100644 (file)
@@ -1016,8 +1016,14 @@ bool client_handle_input(struct client *client)
        if (!handled_commands)
                return FALSE;
 
-       if (client->input_lock == NULL)
+       if (client->input_lock == NULL) {
+               /* finished handling all commands. sync them all at once now. */
                cmd_sync_delayed(client);
+       } else if (client->input_lock->state == CLIENT_COMMAND_STATE_WAIT_UNAMBIGUITY) {
+               /* the command may be waiting for previous command to sync. */
+               if (cmd_sync_delayed(client))
+                       client_continue_pending_input(client);
+       }
        return TRUE;
 }