X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FApache.pm;h=7d11ea42c5f070503857724500dd224a06bc62a5;hb=06e1b6164a2c9d7b463f358b0d1934ef83a82845;hp=a9685499cd83c795dcd2001ea7a9631f300cc550;hpb=e7c0c583d6e12e822dd26bf1282eb610c9a59351;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine/Apache.pm b/lib/Catalyst/Engine/Apache.pm index a968549..7d11ea4 100644 --- a/lib/Catalyst/Engine/Apache.pm +++ b/lib/Catalyst/Engine/Apache.pm @@ -36,15 +36,36 @@ This class overloads some methods from C. =over 4 -=item $c->finalize_output +=item $c->finalize_body =cut -sub finalize_output { +sub finalize_body { my $c = shift; $c->apache->print( $c->response->output ); } +=item $c->prepare_body + +=cut + +sub prepare_body { + my $c = shift; + + my $length = $c->request->content_length; + my ( $buffer, $content ); + + while ($length) { + + $c->apache->read( $buffer, ( $length < 8192 ) ? $length : 8192 ); + + $length -= length($buffer); + $content .= $buffer; + } + + $c->request->input($content); +} + =item $c->prepare_connection =cut @@ -82,7 +103,7 @@ sub prepare_parameters { =cut -# XXX needs fixing, only work with directive, +# XXX needs fixing, only work with directive, # not directive sub prepare_path { my $c = shift; @@ -99,15 +120,6 @@ sub prepare_path { $c->request->base( $base->as_string ); } -=item $c->prepare_request($r) - -=cut - -sub prepare_request { - my ( $c, $r ) = @_; - $c->apache( Apache::Request->new($r) ); -} - =item $c->run =cut