I've reimplemented read_post_body as specified below and the problem
*still* persist. I can only read POST body once. I've looked at
libapreq2 code and they implement "apreq_brigade_copy" which (it
seems) takes a copy of the bucket brigade and passes "the original" on
along.
Can something similar be mimicked in mp2 or do we need additional Apache2 hooks?
sub read_post_body {
my $r = shift;
my $bb = APR::Brigade->new($r->pool, $r->connection->bucket_alloc);
$r->input_filters->get_brigade(
$bb,
Apache2::Const::MODE_READBYTES,
APR::Const::NONBLOCK_READ,
IOBUFSIZE
);
my $len = $bb->flatten(my $buffer);
$buffer;
}