httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: FW: Help with Apache::Request module
Date Wed, 14 Jan 2004 19:54:38 GMT
Joe Schaefer wrote:
> Geoffrey Young <geoff@modperlcookbook.org> writes:
> 
> [...]
> 
> 
>>just one thing of interest.  if the client posts 10MB (assuming it passes
>>the configured POST limit) then all 10MB are always cached? 
> 
> 
> It actually depends on what's going on with the handlers themselves.
> If the first handler is an auth handler which uses libapreq2, then
> the unless the handler NEEDS all 10MB, libapreq2 will just fetch
> enough data for the handler to make its decision.  For instance, if
> it needs to check whether a POST parameter named "password" was set to 
> "foo":
> 
>   sub auth_handler {
>         my $req = Apache::Request->new(shift);
> 
>         if ($req->param("password") eq "foo") {
>             return OK;
>         }        
>         else {
>             return AUTH_ERROR;
>         }
>   }
> 
> The scalar $req->param call will cause libapreq2 to keep fetching POST
> data until it's found the "password" param.  If that param is near
> the front of the POST body, then libapreq2 will have only fetched 
> about 64KB before returning from the param() call.  

What happens if there are two 'password' key/val pairs in the input? Does it 
know from the context whether one is enough? .e.g will:

   @passwords = $req->param("password");

deterministically consume all the input?




__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message