[CR]LF belongs to the MIME boundary though. */
if (ctx->prev_hdr_newline_size > 0) {
i_assert(ctx->part->header_size.lines > 0);
+ /* remove the newline size from the MIME header */
ctx->part->header_size.lines--;
ctx->part->header_size.physical_size -=
ctx->prev_hdr_newline_size;
- ctx->part->header_size.virtual_size -=
+ ctx->part->header_size.virtual_size -= 2;
+ /* add the newline size to the parent's body */
+ ctx->part->parent->body_size.lines++;
+ ctx->part->parent->body_size.physical_size +=
ctx->prev_hdr_newline_size;
- if (ctx->prev_hdr_newline_size == 1)
- ctx->part->header_size.virtual_size--;
+ ctx->part->parent->body_size.virtual_size += 2;
}
hdr = NULL;
}
test_assert(message_parser_deinit(&parser, &parts) == 0);
test_assert((parts->flags & MESSAGE_PART_FLAG_MULTIPART) != 0);
+ test_assert(parts->body_size.lines == 8);
+ test_assert(parts->body_size.physical_size == 112);
+ test_assert(parts->body_size.virtual_size == 112+7);
test_assert(parts->children->header_size.physical_size == 0);
test_assert(parts->children->body_size.physical_size == 0);
test_assert(parts->children->body_size.lines == 0);