Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7524:c4342385d696 HEAD
If client tries to change the selected mailbox state while another command
is still running, wait until the command is finished.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 16 May 2008 23:43:56 +0300 |
parents | 15ddb7513e2d |
children | 4c70d5f54409 |
files | src/imap/client.c src/imap/commands.h |
diffstat | 2 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/client.c Fri May 16 12:09:44 2008 +0300 +++ b/src/imap/client.c Fri May 16 23:43:56 2008 +0300 @@ -352,7 +352,12 @@ enum command_flags flags; bool broken_client = FALSE; - if ((cmd->cmd_flags & COMMAND_FLAG_USES_SEQS) != 0) { + if ((cmd->cmd_flags & COMMAND_FLAG_BREAKS_MAILBOX) == + COMMAND_FLAG_BREAKS_MAILBOX) { + /* there must be no other command running that uses the + selected mailbox */ + flags = COMMAND_FLAG_USES_MAILBOX; + } else if ((cmd->cmd_flags & COMMAND_FLAG_USES_SEQS) != 0) { /* no existing command must be breaking sequences */ flags = COMMAND_FLAG_BREAKS_SEQS; broken_client = TRUE;
--- a/src/imap/commands.h Fri May 16 12:09:44 2008 +0300 +++ b/src/imap/commands.h Fri May 16 23:43:56 2008 +0300 @@ -16,7 +16,11 @@ /* Command may reply with EXPUNGE, causing sequences to break */ COMMAND_FLAG_BREAKS_SEQS = 0x02, /* Command changes the mailbox */ - COMMAND_FLAG_BREAKS_MAILBOX = 0x04 | COMMAND_FLAG_BREAKS_SEQS + COMMAND_FLAG_BREAKS_MAILBOX = 0x04 | COMMAND_FLAG_BREAKS_SEQS, + + /* Command uses selected mailbox */ + COMMAND_FLAG_USES_MAILBOX = COMMAND_FLAG_BREAKS_MAILBOX | + COMMAND_FLAG_USES_SEQS }; struct command {