Re: proper use of $r->read?

E R <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.