[Catalyst] Questions about $c->write

Andy Grundman andy at hybridized.org
Sat May 5 15:33:46 GMT 2007


On May 5, 2007, at 10:08 AM, Bernhard Graf wrote:

> While working on my View classes (see
> http://lists.scsys.co.uk/pipermail/catalyst/2007-May/013120.html)
> I found this (sparse) description about Catalyst::Engine::write():
>
>  Writes the buffer to the client. Can only be called once for a  
> request.
>
> Is the second phrase correct? I couldn't see why and at least
> finalize_body() from the same package can do many calls to write() for
> one request.

That's not correct, write() can be called as many times as needed to  
send data.  See the implementation of finalize_body in  
Catalyst::Engine for one example.

> Then I'm a little confused about Catalyst::Engine::FastCGI::write():
> In the source you find
>
> *STDOUT->syswrite($buffer);
>
> Looks like IO::Handle is loaded somewhere, but this turns out as a
> mistake, because other than documented this syswrite() doesn't return
> the number of bytes written - at least not as a Perl integer value,  
> but
> instead returns the size as a binary value.
> Because the class of this syswrite hides behind the STDOUT glob,  
> I'm not
> able to track this bug up to the origin.
>
> Anybody knows what's behind the file handles in this module?

What bug are you seeing?



More information about the Catalyst mailing list