dovecot-2.2: pop3c: Don't get size of TOP output and cache it as...

dovecot at dovecot.org dovecot at dovecot.org
Fri Aug 10 05:24:40 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/8ef2b31b125f
changeset: 14782:8ef2b31b125f
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jul 07 16:27:59 2012 +0300
description:
pop3c: Don't get size of TOP output and cache it as message's virtual size.

diffstat:

 src/lib-storage/index/pop3c/pop3c-mail.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r b3e1111e7f49 -r 8ef2b31b125f src/lib-storage/index/pop3c/pop3c-mail.c
--- a/src/lib-storage/index/pop3c/pop3c-mail.c	Wed Jul 04 11:02:58 2012 +0300
+++ b/src/lib-storage/index/pop3c/pop3c-mail.c	Sat Jul 07 16:27:59 2012 +0300
@@ -110,10 +110,12 @@
 
 	if (mail->data.stream == NULL) {
 		capa = pop3c_client_get_capabilities(mbox->client);
-		if (get_body || (capa & POP3C_CAPABILITY_TOP) == 0)
+		if (get_body || (capa & POP3C_CAPABILITY_TOP) == 0) {
 			cmd = t_strdup_printf("RETR %u\r\n", _mail->seq);
-		else
+			get_body = TRUE;
+		} else {
 			cmd = t_strdup_printf("TOP %u 0\r\n", _mail->seq);
+		}
 		if (pop3c_client_cmd_stream(mbox->client, cmd,
 					    &input, &error) < 0) {
 			mail_storage_set_error(mbox->box.storage,
@@ -130,7 +132,8 @@
 			}
 		}
 		i_stream_set_name(mail->data.stream, t_strcut(cmd, '\r'));
-		pop3c_mail_cache_size(mail);
+		if (get_body)
+			pop3c_mail_cache_size(mail);
 	}
 	return index_mail_init_stream(mail, hdr_size, body_size, stream_r);
 }


More information about the dovecot-cvs mailing list