[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: mod_perl and Transfer-Encoding: chunked
From:       Torsten_Förtsch <torsten.foertsch () gmx ! net>
Date:       2013-07-05 12:51:18
Message-ID: 51D6C146.7000108 () gmx ! net
[Download RAW message or body]

On 04/07/13 17:48, Bill Moseley wrote:
> Applications probably don't
> need to care.  They should receive the body -- so for mod_perl that means
> reading data using $r->read until there's no more to read and then the app
> should never need to look at the Transfer-Encoding header -- or
> Content-Length header for that matter by that reasoning.

Modperl simply makes (most of) the httpd interface available to perl. I
see no reason to remove the TE header in modperl. If httpd decides to do
that, so be it. Modperl must not.

$r->read is simply a convenience layer on top of bucket brigades. If you
don't like $r->read, fetch the buckets from the input filter chain.

But I see, the documentation of $r->read could be improved.

Note, it's also safer to use bucket brigades directly unless you know
your input filters quite well. Have a look at the XXX comment in
modperl_request_read in modperl_io_apache.c. Normally, httpd tries to
reads its input in 8k chunks. So, providing a buffer of 10k to $r->read
should be enough. Though, you don't have to provide the actual space.
$r->read expands the provided buffer as necessary. Only make sure not to
pass a length parameter that is too small.

Actually, I think we should either ignore the length parameter and pass
the flattened brigade to the caller or we should introduce some kind of
buffering to remove that XXX bug.

I'd prefer the former.

Opinions?

Torsten
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic