From: Timo Sirainen Date: Tue, 24 Nov 2015 09:50:15 +0000 (+0200) Subject: imap: Fixed hanging if a pipelined IMAP command was waiting for previous command... X-Git-Tag: 2.2.20.rc1~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6116f4cd50f66ea3d1793e6d4da63373c5736115;p=thirdparty%2Fdovecot%2Fcore.git imap: Fixed hanging if a pipelined IMAP command was waiting for previous command to sync. ..And the previous command was waiting for the next command to finish before it would start syncing. For example FETCH+LOGOUT pipelined. --- diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 33d2c7b145..34b6e9ae1e 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -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; }