changeset 5135:1a7359d6a774 HEAD

RSET: Don't rollback the transaction if LAST is enabled (there's no point, because all the seen flags are removed anyway).
author Timo Sirainen <tss@iki.fi>
date Thu, 15 Feb 2007 14:12:55 +0200
parents b2070dffa074
children 86625faa49b5
files src/pop3/commands.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/pop3/commands.c	Thu Feb 15 13:51:33 2007 +0200
+++ b/src/pop3/commands.c	Thu Feb 15 14:12:55 2007 +0200
@@ -452,12 +452,8 @@
 		client->deleted_size = 0;
 	}
 
-	/* forget all our seen flag updates as well.. */
-	mailbox_transaction_rollback(&client->trans);
-	client->trans = mailbox_transaction_begin(client->mailbox, 0);
-
 	if (enable_last_command) {
-		/* remove all \Seen flags */
+		/* remove all \Seen flags (as specified by RFC 1460) */
 		memset(&seqset, 0, sizeof(seqset));
 		memset(&search_arg, 0, sizeof(search_arg));
 		seqset.seq1 = 1;
@@ -475,6 +471,11 @@
 		}
 		mail_free(&mail);
 		(void)mailbox_search_deinit(&search_ctx);
+	} else {
+		/* forget all our seen flag updates.
+		   FIXME: is this needed? it loses data added to cache file */
+		mailbox_transaction_rollback(&client->trans);
+		client->trans = mailbox_transaction_begin(client->mailbox, 0);
 	}
 
 	client_send_line(client, "+OK");