dovecot-2.2: pop3: If transcation commit failed at QUIT, don't l...

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 19 11:33:56 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/ff9a9ffcd2af
changeset: 18978:ff9a9ffcd2af
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 19 14:30:09 2015 +0300
description:
pop3: If transcation commit failed at QUIT, don't log any messages as expunged.

diffstat:

 src/pop3/pop3-client.c   |  3 ++-
 src/pop3/pop3-client.h   |  3 ++-
 src/pop3/pop3-commands.c |  3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r 412de6dea139 -r ff9a9ffcd2af src/pop3/pop3-client.c
--- a/src/pop3/pop3-client.c	Wed Aug 19 13:41:54 2015 +0300
+++ b/src/pop3/pop3-client.c	Wed Aug 19 14:30:09 2015 +0300
@@ -535,7 +535,8 @@
 	tab[1].value = dec2str(client->top_count);
 	tab[2].value = dec2str(client->retr_bytes);
 	tab[3].value = dec2str(client->retr_count);
-	tab[4].value = dec2str(client->expunged_count);
+	tab[4].value = client->delete_success ?
+		dec2str(client->deleted_count) : 0;
 	tab[5].value = dec2str(client->messages_count);
 	tab[6].value = dec2str(client->total_size);
 	tab[7].value = dec2str(client->input->v_offset);
diff -r 412de6dea139 -r ff9a9ffcd2af src/pop3/pop3-client.h
--- a/src/pop3/pop3-client.h	Wed Aug 19 13:41:54 2015 +0300
+++ b/src/pop3/pop3-client.h	Wed Aug 19 14:30:09 2015 +0300
@@ -62,7 +62,7 @@
 
 	unsigned int uid_validity;
 	unsigned int messages_count;
-	unsigned int deleted_count, expunged_count, seen_change_count;
+	unsigned int deleted_count, seen_change_count;
 	uoff_t total_size;
 	uoff_t deleted_size;
 	uint32_t last_seen_pop3_msn, lowest_retr_pop3_msn;
@@ -100,6 +100,7 @@
 	unsigned int waiting_input:1;
 	unsigned int anvil_sent:1;
 	unsigned int message_uidls_save:1;
+	unsigned int delete_success:1;
 };
 
 struct pop3_module_register {
diff -r 412de6dea139 -r ff9a9ffcd2af src/pop3/pop3-commands.c
--- a/src/pop3/pop3-commands.c	Wed Aug 19 13:41:54 2015 +0300
+++ b/src/pop3/pop3-commands.c	Wed Aug 19 14:30:09 2015 +0300
@@ -228,7 +228,6 @@
 		mail_update_keywords(mail, MODIFY_ADD, client->deleted_kw);
 		break;
 	}
-	client->expunged_count++;
 }
 
 bool client_update_mails(struct client *client)
@@ -297,6 +296,8 @@
 		client_send_storage_error(client);
 		client_disconnect(client, "Storage error during logout.");
 		return 1;
+	} else {
+		client->delete_success = TRUE;
 	}
 
 	if (!client->deleted)


More information about the dovecot-cvs mailing list