- Improved: Params handling with MP engines
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Apache.pm
index 7d11ea4..a6b763c 100644 (file)
@@ -18,7 +18,7 @@ See L<Catalyst>.
 
 =head1 DESCRIPTION
 
-This is the Catalyst engine specialized for Apache (i.e. for mod_perl).
+This is a base class engine specialized for Apache (i.e. for mod_perl).
 
 =head1 METHODS
 
@@ -42,7 +42,7 @@ This class overloads some methods from C<Catalyst::Engine>.
 
 sub finalize_body {
     my $c = shift;
-    $c->apache->print( $c->response->output );
+    $c->apache->print( $c->response->body );
 }
 
 =item $c->prepare_body
@@ -63,7 +63,7 @@ sub prepare_body {
         $content .= $buffer;
     }
     
-    $c->request->input($content);
+    $c->request->body($content);
 }
 
 =item $c->prepare_connection
@@ -93,10 +93,15 @@ sub prepare_headers {
 sub prepare_parameters {
     my $c = shift;
 
-    foreach my $key ( $c->apache->param ) {
-        my @values = $c->apache->param($key);
-        $c->req->parameters->{$key} = ( @values == 1 ) ? $values[0] : \@values;
-    }
+    my @params;
+    
+    $c->apache->param->do( sub {
+        my ( $field, $value ) = @_;
+        push( @params, $field, $value );
+        return 1;    
+    });
+    
+    $c->req->_assign_values( $c->req->parameters, \@params );
 }
 
 =item $c->prepare_path
@@ -135,6 +140,7 @@ L<Catalyst>.
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@cpan.org>
+Christian Hansen C<ch@ngmedia.com>
 
 =head1 COPYRIGHT