body truncated on extra reads

body truncated on extra reads

am 22.04.2008 16:51:17 von John ORourke

Hi folks,

I'm curious - can anyone explain what actually happens internally if you
try to read more from $r->read() than specified in the Content-Length
header?

I noticed when trying subsequent calls to read after all bytes had been
read that it truncates the buffer, which I guess is understandable as it
could be the next request. I'm just wondering wether $r->read( $buffer,
1000 ) is a bad thing to do if the incoming content is only 900 bytes.

cheers
John

Re: body truncated on extra reads

am 22.04.2008 21:38:18 von Perrin Harkins

On Tue, Apr 22, 2008 at 10:51 AM, John ORourke
wrote:
> I'm curious - can anyone explain what actually happens internally if you
> try to read more from $r->read() than specified in the Content-Length
> header?

What used to happen is it would hang the process forever. Not sure if
it still does. Is there a reason you're not using Apache2::Request or
CGI.pm?

- Perrin