[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl-dev
Subject:    [mp2] non-parsed headers registry scripts
From:       Stas Bekman <stas () stason ! org>
Date:       2003-11-24 9:16:54
[Download RAW message or body]

The following rfc was triggered by 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24501
I added a test for mod_cgi and it works just fine, despite the report, but 
mod_perl indeed doesn't work with nph- scripts.

In mp1 it was easy to set a location for non-parsed headers by turning the 
headers parsing option off. This doesn't work in httpd-2.0 -- if headers 
aren't parsed and httpd-2.0 can make a sense of what the output should be like 
it will just send its own httpd headers.

Moreover if you look at mod_cgi.c:818, if the script's name starts with 'nph-' 
it'll cheat at internally remove all the protocol filters which mess with 
headers letting the script do its own thing.

The only way mod_perl users can send unparsed headers is by calling:

   $r->assbackwards(1);

in their code (as kindly mentioned by Geoff a few months ago).

The problem is that this doesn't work for registry scripts striving to be 
compatible with mod_cgi, i.e. run unmodified.

Therefore I thought of two posible solutions:

1) Introduce a new option:

   PerlOptions +NonParseHeaders

which will do just that, call: $r->assbackwards(1) at the beginning of the 
response phase.

2) An alternative solution is to mess with RegistryCooker to match /npn-/ and 
call $r->assbackwards(1) on behalf of the script.

The first solution closely matches mp1, by giving users control over the 
naming of the scripts and even handlers.

The second solution matches 1:1 mod_cgi, which hardcodes 'nph-' condition.

Which solution do you think is the best?

Also I'm not hardwired on 'PerlOptions +NonParseHeaders' so other names are 
welcome if you prefer the first option.

__________________________________________________________________
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic