perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From E R <pc88m...@gmail.com>
Subject Re: proper use of $r->read?
Date Wed, 27 Apr 2011 19:25:46 GMT
Hi Torsten,

So is this what you are suggesting...

Define $MAX_SIZE to be the largest length of POSTed data you will accept.

For modperl <= 2.0.4 just use a single read and hope for the best:

  $r->read($buf, $MAX_SIZE);

For modperl > 2.0.4 ( >= 2.0.5?) using this while-loop works:

  my $buf = "";
  1 while (length($buf) < $MAX_SIZE) && $r->read($buf, $MAX_SIZE, length($buf));

Thanks,
ER

Mime
View raw message