unless ( $body->state eq 'done' ) {
die 'baaaaaaaaad';
}
- },
- 'HTTP::Body Complete' => sub {
-
- my $body = HTTP::Body->new( $headers->{'Content-Type'},
- $headers->{'Content-Length'} );
-
- $body->add($message);
-
- unless ( $body->state eq 'done' ) {
- die 'baaaaaaaaad';
- }
- },
+ }
};
if ( eval 'require CGI::Simple' ) {
};
}
+if ( eval 'require APR::Request' ) {
+
+ require APR;
+ require APR::Pool;
+ require APR::Request;
+ require APR::Request::CGI;
+ require APR::Request::Param;
+
+ $benchmarks->{'APR::Request'} = sub {
+
+ $content->seek( 0, SEEK_SET )
+ or die $!;
+
+ STDIN->fdopen( $content->fileno, 'r' );
+
+ my $pool = APR::Pool->new;
+ my $apr = APR::Request::CGI->handle($pool);
+
+ if ( my $table = $apr->param ) {
+ $table->do( sub { 1 } );
+ }
+
+ if ( my $body = $apr->body ) {
+ $body->param_class('APR::Request::Param');
+ $body->uploads($pool)->do( sub { 1 } );
+ }
+ };
+}
+
my @benchmarks = @ARGV ? @ARGV : qw[ t/data/benchmark/001
t/data/benchmark/002
t/data/benchmark/003 ];
binmode($content);
- $message = do{ local $/; <$content> };
-
local %ENV = (
CONTENT_LENGTH => $headers->{'Content-Length'},
CONTENT_TYPE => $headers->{'Content-Type'},