dovecot-1.0: Fixed "got too little data" with mboxes.

dovecot at dovecot.org dovecot at dovecot.org
Tue Dec 11 20:32:05 EET 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/7c83c2d9c378
changeset: 5487:7c83c2d9c378
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Dec 11 20:32:02 2007 +0200
description:
Fixed "got too little data" with mboxes.

diffstat:

1 file changed, 7 insertions(+), 7 deletions(-)
src/imap/imap-fetch-body.c |   14 +++++++-------

diffs (24 lines):

diff -r 813bd051fc5f -r 7c83c2d9c378 src/imap/imap-fetch-body.c
--- a/src/imap/imap-fetch-body.c	Tue Dec 11 19:13:40 2007 +0200
+++ b/src/imap/imap-fetch-body.c	Tue Dec 11 20:32:02 2007 +0200
@@ -327,13 +327,13 @@ static int fetch_body(struct imap_fetch_
 	struct message_size hdr_size, body_size;
 
 	if (body->section[0] == '\0') {
-		ctx->cur_input = mail_get_stream(mail, NULL, NULL);
-
-		body_size.virtual_size = mail_get_virtual_size(mail);
-		body_size.physical_size = mail_get_physical_size(mail);
-		if (body_size.virtual_size == (uoff_t)-1 ||
-		    body_size.physical_size == (uoff_t)-1)
-			return -1;
+		/* FIXME: We really wouldn't have to know header size here
+		   specifically, but with mbox mail_get_physical_size() returns
+		   the real current size on disk, not the size that the stream
+		   has. This may cause virtual_size==physical_size and break
+		   our checks. */
+		ctx->cur_input = mail_get_stream(mail, &hdr_size, &body_size);
+		message_size_add(&body_size, &hdr_size);
 	} else {
 		ctx->cur_input = mail_get_stream(mail, &hdr_size,
 						 body->section[0] == 'H' ?


More information about the dovecot-cvs mailing list