X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FAction%2FStreaming.pm;h=08c7c6547a0d679d39c5798f09af3521543c5c02;hb=a9b467d3d36fc47a5fc63b5c8b13141b89bc9fd7;hp=5a757b0ac5e57dae1ae7a94343a2a76d7841929e;hpb=3a64ecc98bfc0defbba6a510134f87793d059e2d;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Action/Streaming.pm b/t/lib/TestApp/Controller/Action/Streaming.pm index 5a757b0..08c7c65 100644 --- a/t/lib/TestApp/Controller/Action/Streaming.pm +++ b/t/lib/TestApp/Controller/Action/Streaming.pm @@ -16,7 +16,7 @@ EOF sub body : Local { my ( $self, $c ) = @_; - + my $file = "$FindBin::Bin/../lib/TestApp/Controller/Action/Streaming.pm"; my $fh = IO::File->new( $file, 'r' ); if ( defined $fh ) { @@ -27,4 +27,16 @@ sub body : Local { } } +sub body_large : Local { + my ($self, $c) = @_; + + # more than one write with the default chunksize + my $size = 128 * 1024; + + my $data = "\0" x $size; + open my $fh, '<', \$data; + $c->res->content_length($size); + $c->res->body($fh); +} + 1;