[cgiapp] Re: CGI::Application::Server and CGI::Application::Plugin::Stream

Mark Stosberg mark at summersault.com
Mon Dec 29 19:00:07 EST 2008


On Sun, 28 Dec 2008 21:59:02 -0700
Bradley C Bailey <cgiapp at brad.memoryleak.org> wrote:

> Hello,
> 
> I run my application under CGI::Application::Server during testing, and 
> recently began sending files with CGI::Application::Plugin::Stream.
> 
> However, they do not seem compatible since CAP::Stream directly prints 
> to STDOUT, and CA::Server runs under CGI_APP_RETURN_ONLY and expects the 
> application to return the content.  So CAP::Stream prints the content 
> before CA::Server can print the proper HTTP stuff.
> 
> I attached a simple patch for a workaround, hopefully it goes through. 
> I am not sure this is the best solution though.
> 
> Comments?

My first instinct was to try to solve this from the other direction.
Can ::Server be modified to allow streaming?

Streaming is usually used for large files, the kind you may not want 
to try to fit all in memory at once.

On the other hand, your approach could also be considered reasonable.
If the user has requested the "return only" behavior through the
environment, shouldn't the Stream plugin comply?

I'm interested in the opinions of others as well. 

    Mark

-- 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . 
   Mark Stosberg            Principal Developer  
   mark at summersault.com     Summersault, LLC     
   765-939-9301 ext 202     database driven websites
 . . . . . http://www.summersault.com/ . . . . . . . .




More information about the cgiapp mailing list