dovecot-1.1: If client tries to change the selected mailbox stat...

dovecot at dovecot.org dovecot at dovecot.org
Fri May 16 23:44:03 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/c4342385d696
changeset: 7524:c4342385d696
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 16 23:43:56 2008 +0300
description:
If client tries to change the selected mailbox state while another command
is still running, wait until the command is finished.

diffstat:

2 files changed, 11 insertions(+), 2 deletions(-)
src/imap/client.c   |    7 ++++++-
src/imap/commands.h |    6 +++++-

diffs (33 lines):

diff -r 15ddb7513e2d -r c4342385d696 src/imap/client.c
--- 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 @@ static bool client_command_check_ambigui
 	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;
diff -r 15ddb7513e2d -r c4342385d696 src/imap/commands.h
--- 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 @@ enum command_flags {
 	/* 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 {


More information about the dovecot-cvs mailing list