]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Earlier changes broke message parsing near EOF.
authorTimo Sirainen <tss@iki.fi>
Sun, 5 Oct 2008 13:37:38 +0000 (16:37 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 5 Oct 2008 13:37:38 +0000 (16:37 +0300)
--HG--
branch : HEAD

src/lib-mail/message-parser.c

index 98b8f0d6c7b61c202c6c50fcf940b1e24bc62c06..a8d1213ecc0ed1462f2413aa88a08b482f6822a2 100644 (file)
@@ -389,8 +389,10 @@ static int parse_next_body_to_boundary(struct message_parser_ctx *ctx,
        }
        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) {