changeset 8237:5adb665bfc0c HEAD

Earlier changes broke message parsing near EOF.
author Timo Sirainen <tss@iki.fi>
date Sun, 05 Oct 2008 16:37:38 +0300
parents 4b9a7920e774
children 93e01a80cb8e
files src/lib-mail/message-parser.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-mail/message-parser.c	Sun Oct 05 16:16:48 2008 +0300
+++ b/src/lib-mail/message-parser.c	Sun Oct 05 16:37:38 2008 +0300
@@ -389,8 +389,10 @@
 	}
 	i_assert(!(ret == 0 && full));
 
-	if (ret >= 0 && !ctx->eof) {
-		/* leave CR+LF + last line to buffer */
+	if (ret > 0 || (ret == 0 && !ctx->eof)) {
+		/* a) we found the boundary
+		   b) we need more data and haven't reached EOF yet
+		   so leave CR+LF + last line to buffer */
 		block_r->size = boundary_start;
 	}
 	if (block_r->size != 0) {