]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: When multiple commands are pipelined, try harder to combine their mailbox synci...
authorTimo Sirainen <tss@iki.fi>
Thu, 14 May 2009 21:20:51 +0000 (17:20 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 14 May 2009 21:20:51 +0000 (17:20 -0400)
--HG--
branch : HEAD

src/imap/imap-client.c

index 14923e9a6e5bac935ccec3c0ce3a3859221def57..f81470144c2f45bef0d9a4b4a11b995ed8b60df9 100644 (file)
@@ -402,7 +402,8 @@ 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 != new_cmd && (cmd->cmd_flags & flags) != 0)
+               if (cmd->state < CLIENT_COMMAND_STATE_WAIT_SYNC &&
+                   cmd != new_cmd && (cmd->cmd_flags & flags) != 0)
                        return cmd;
        }
        return NULL;
@@ -745,7 +746,8 @@ bool client_handle_input(struct client *client)
                if (!handled_commands)
                        return FALSE;
 
-               ret = cmd_sync_delayed(client);
+               ret = client->input_lock != NULL ? TRUE :
+                       cmd_sync_delayed(client);
                if (ret)
                        client_continue_pending_input(&client);
                return TRUE;