Re: Reading post-data

2007-06-20 Thread Reif Peter
Reif Peter wrote: Unfortunately you cannot tell $r-read to read just all of the data, you must provide a length. How do I solve this problems. $r-read will return 0 when no more data is available. I have been using the following simple code with success: my $postdata = ;

Re: Reading post-data

2007-06-20 Thread Fred Moyer
Reif Peter wrote: Reif Peter wrote: my $postdata = ; while ($r-read(my $buf, 8192)) { $postdata .= $buf; } You should ofcourse select a read-buffer size that will best suite your setup. I do not know what would be the most optimal setting here. Yes, this code works and I am using it, too.

AW: Reading post-data

2007-06-20 Thread Reif Peter
Yes, this code works and I am using it, too. But the documentation says, you can use $r-read($buf, $r-headers_in-{'content-length'} this statement reads the entire request content in one iteration by using a read buffer size equal to the content-length of the request.

Reading post-data

2007-06-11 Thread Reif Peter
In http://perl.apache.org/docs/2.0/user/porting/compat.html I read: if one wishes to simply read POST data, there is the more modern filter API, along with continued support for read(STDIN, ...) and $r-read($buf, $r-headers_in-{'content-length'}) But there are two problems with $r-read($buf,

Re: Reading post-data

2007-06-11 Thread Jani M.
Reif Peter wrote: Unfortunately you cannot tell $r-read to read just all of the data, you must provide a length. How do I solve this problems. $r-read will return 0 when no more data is available. I have been using the following simple code with success: my $postdata = ; while ($r-read(my

Re: Reading post data from separate handlers

2006-02-14 Thread William A. Rowe, Jr.
Blayne Bayer wrote: I have a problem that hopefully somebody has encountered or can point me in the right direction. We use the latest embperl 1.xxx release on linux. I have created a handler to do authentication before the embperl handler is run. This new handler needs to read data from the

Re: reading post data.

2005-04-26 Thread Dermot Paikkos
On 23 Apr 2005 at 16:16, jonathan vanasco wrote: RC5 is slightly different from the namespace stuff, and you need to run one of the svn branches of libapreq -- either trunk or multi-env -- its under active development right now personally, i think libapreq is the best way to read GET/POST

Re: reading post data.

2005-04-26 Thread Philip M. Gollucci
Dermot Paikkos wrote: Does that mean there is no performance penalty or other price for using CGI instead of libapreq? I've done know benchmarks, but I'd be hard pressed to find anycase where XS code is slower then PERL code. libapreq2 is a thin PERL wrapper around the C interfaces written in

reading post data.

2005-04-23 Thread Michael Schout
I am wondering what the best way is to read POST data under MP2. In MP1, I was using $r-content for this. In MP2, $r-content does not exist, so I used the version from an earlier copy of Apache::compat, which was using $r-get_client_block() instead. Now, get_client_block() is apparently

Re: reading post data.

2005-04-23 Thread jonathan vanasco
works in RC4 + libapreq 2.04 use Apache::Request() sub handler { my $r = shift; my $apr = Apache::Request-new( $r , DISABLE_UPLOADS=0, POST_MAX=10 ); $stringvalue = $apr-param($stringname); } RC5 is slightly different from the namespace stuff, and you need to run one of the svn

Re: reading post data.

2005-04-23 Thread Stas Bekman
Michael Schout wrote: I am wondering what the best way is to read POST data under MP2. In MP1, I was using $r-content for this. In MP2, $r-content does not exist, so I used the version from an earlier copy of Apache::compat, which was using $r-get_client_block() instead. Now, get_client_block()

Re: reading POST data problem

2004-07-12 Thread Stas Bekman
Stas Bekman wrote: eps com estem wrote: Hi, i had already tested the $r-read but it did not work, now i have found why. $r-read(my $buffer, $len) only works if $buffer is a string. $r-read($ref-{buffer}, $len) does not work, as $ref-{buffer} is empty. And that was what i was using, so i though a

reading POST data problem

2004-07-11 Thread eps com estem
Hi. I used to read POST data with the sentence read (STDIN,$var,$r_headers-{'Content-length'}); When the handler was invoked after submitting the formulary. But, lately i changed the handler configured in apache.conf by a parsing URI module. There i catch the direction of the form submit and

Re: reading POST data problem

2004-07-11 Thread Stas Bekman
eps com estem wrote: Hi. I used to read POST data with the sentence read (STDIN,$var,$r_headers-{'Content-length'}); When the handler was invoked after submitting the formulary. But, lately i changed the handler configured in apache.conf by a parsing URI module. There i catch the direction of the

Re: reading POST data problem

2004-07-11 Thread eps com estem
Hi, i had already tested the $r-read but it did not work, now i have found why. $r-read(my $buffer, $len) only works if $buffer is a string. $r-read($ref-{buffer}, $len) does not work, as $ref-{buffer} is empty. And that was what i was using, so i though a long time ago it was some kind of

Re: reading POST data problem

2004-07-11 Thread Stas Bekman
eps com estem wrote: Hi, i had already tested the $r-read but it did not work, now i have found why. $r-read(my $buffer, $len) only works if $buffer is a string. $r-read($ref-{buffer}, $len) does not work, as $ref-{buffer} is empty. And that was what i was using, so i though a long time ago it was