ctx->part = ctx->part->parent;
}
+static void
+boundary_remove_until(struct message_parser_ctx *ctx,
+ struct message_boundary *boundary)
+{
+ ctx->boundaries = boundary;
+}
+
static void parse_next_body_multipart_init(struct message_parser_ctx *ctx)
{
struct message_boundary *b;
if (boundary->epilogue_found) {
/* this boundary isn't needed anymore */
- ctx->boundaries = boundary->next;
+ boundary_remove_until(ctx, boundary->next);
} else {
/* forget about the boundaries we possibly skipped */
- ctx->boundaries = boundary;
+ boundary_remove_until(ctx, boundary);
}
/* the boundary itself should already be in buffer. add that. */