On 05/07/2006, at 5:47, Stas Bekman wrote:
http://perl.apache.org/docs/2.0/user/handlers/
filters.html#HTTP_Request_vs__Connection_Filters
OK Some very weird and interesting problems here. I think they are
bugs, but I am not certain.
Firstly - if you write the code... (straight from the example in the
POD and URL above)
package MyApache2::FilterRequestFoo;
use base qw(Apache2::Filter);
sub output : FilterRequestHandler {
my ($f, $bb) = @_;
}
1;
You get this:
~/tmp$ perl -c test.pm
Invalid CODE attribute: FilterRequestHandler at test.pm line 4
BEGIN failed--compilation aborted at test.pm line 6.
So I went back to the core code and the tests. The test that use
FilterRequestHandler is t/filter/TestFilter/out_init_basic.pm (and
some others) but that reports the same problem:
[EMAIL PROTECTED]:521:~/src/mod_perl-2.0.2/t$ perl -c filter/TestFilter/
out_init_basic.pm
Invalid CODE attribute: FilterInitHandler at filter/TestFilter/
out_init_basic.pm line 22
BEGIN failed--compilation aborted at filter/TestFilter/
out_init_basic.pm line 35.
On searching the entire archive for FilterRequestHandler I find
[EMAIL PROTECTED]:527:~/src/mod_perl-2.0.2$ grep -r FilterRequestHandler *|
grep -v blib|grep -v doc
Changes:handler is not required to have the FilterRequestHandler
attribute as
src/modules/perl/modperl_filter.c: /* needs to have the
FilterRequestHandler attribute, but
src/modules/perl/modperl_filter.c: * have the
FilterRequestHandler attribute, croak only if
src/modules/perl/modperl_filter.c: * FilterRequestHandler */
src/modules/perl/modperl_filter.c:
"FilterRequestHandler attribute set",
t/lib/TestCommon/FilterDebug.pm:sub snoop_request :
FilterRequestHandler { snoop("request", @_) }
t/filter/TestFilter/out_init_basic.pm:sub transparent :
FilterRequestHandler
t/filter/TestFilter/in_bbs_body.pm:sub handler : FilterRequestHandler {
t/filter/TestFilter/in_init_basic.pm:sub transparent :
FilterRequestHandler
t/filter/TestFilter/in_str_msg.pm:sub req : FilterRequestHandler {
Ignoring the 't' directory above for tests, and I already removed the
doc directory - then there is actually only one reference to the text
'FilterRequestHandler' at all - and that is in the string
"FilterRequestHandler attribute set"
Within the XS code it is referred to as MP_FILTER_REQUEST_HANDLER -
which is assigned the value 0x02 - but there does not seem to be a
way to get from the perl FilterRequstHandler to
MP_FILTER_REQUEST_HANDLER
Versions:
Perl 5.8.6 - tested with Attributes fine, so the problem is not
likely perl
mod_perl 2.0.2 - current release
Apache 2.2 - current release
I am a bit lost - it seems to me that the attributes
FilterRequestHandler, FilterInitHandler etc can not work in the
current release.
But... maybe I have missed something ?
Scott