httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: FW: Help with Apache::Request module
Date Wed, 14 Jan 2004 20:21:36 GMT
Stas Bekman <stas@stason.org> writes:

> Joe Schaefer wrote:

[...]

> >   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?

I'm not sure what the current code actually does (there's this strange
prefetch apreq_cfg_t attribute I've been meaning to remove), but IMO 
what it should do here is parse the entire POST.  So yes, the behavior 
would be context-sensitive.

-- 
Joe Schaefer


Mime
View raw message