dovecot-1.2: CLOSE: Don't send any mailbox changes or HIGHESTMOD...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Sep 5 19:33:45 EEST 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/5ca8140fcc95
changeset: 8157:5ca8140fcc95
user: Timo Sirainen <tss at iki.fi>
date: Fri Sep 05 19:33:41 2008 +0300
description:
CLOSE: Don't send any mailbox changes or HIGHESTMODSEQ to client.
Also the previous code wasn't really even closing the mailbox.
diffstat:
1 file changed, 9 insertions(+), 27 deletions(-)
src/imap/cmd-close.c | 36 +++++++++---------------------------
diffs (56 lines):
diff -r f77a285629a5 -r 5ca8140fcc95 src/imap/cmd-close.c
--- a/src/imap/cmd-close.c Fri Sep 05 19:22:07 2008 +0300
+++ b/src/imap/cmd-close.c Fri Sep 05 19:33:41 2008 +0300
@@ -3,16 +3,6 @@
#include "common.h"
#include "commands.h"
#include "imap-expunge.h"
-
-static void cmd_close_finish(struct client *client)
-{
- client_search_updates_free(client);
- if (mailbox_close(&client->mailbox) < 0) {
- client_send_untagged_storage_error(client,
- mailbox_get_storage(client->mailbox));
- }
- client_update_mailbox_flags(client, NULL);
-}
bool cmd_close(struct client_command_context *cmd)
{
@@ -25,26 +15,18 @@ bool cmd_close(struct client_command_con
return TRUE;
i_assert(client->mailbox_change_lock == NULL);
- client->mailbox_change_lock = cmd;
+ client->mailbox = NULL;
storage = mailbox_get_storage(mailbox);
if ((ret = imap_expunge(mailbox, NULL)) < 0)
client_send_untagged_storage_error(client, storage);
+ if (mailbox_sync(mailbox, 0, 0, NULL) < 0)
+ client_send_untagged_storage_error(client, storage);
- if ((client->enabled_features & MAILBOX_FEATURE_QRESYNC) != 0 &&
- ret > 0) {
- /* we expunged something. since we're sending updated
- HIGHESTMODSEQ make sure the client sees all changes up to
- it by syncing the mailbox one last time. We wouldn't need
- to include our own expunge in there, but it's too much
- trouble to hide it. */
- return cmd_sync(cmd, MAILBOX_SYNC_FLAG_EXPUNGE,
- IMAP_SYNC_FLAG_SAFE, "OK Close completed.");
- } else {
- if (mailbox_sync(mailbox, 0, 0, NULL) < 0)
- client_send_untagged_storage_error(client, storage);
- cmd_close_finish(client);
- client_send_tagline(cmd, "OK Close completed.");
- return TRUE;
- }
+ if (mailbox_close(&mailbox) < 0)
+ client_send_untagged_storage_error(client, storage);
+ client_update_mailbox_flags(client, NULL);
+
+ client_send_tagline(cmd, "OK Close completed.");
+ return TRUE;
}
More information about the dovecot-cvs
mailing list