stas 2003/03/30 17:50:52
Modified: . Changes
src/modules/perl modperl_mgv.c
t/filter/TestFilter both_str_con_add.pm both_str_rec_add.pm
in_bbs_body.pm in_str_consume.pm in_str_declined.pm
in_str_lc.pm in_str_sandwich.pm out_bbs_basic.pm
out_bbs_ctx.pm out_str_api.pm out_str_ctx.pm
out_str_declined.pm out_str_reverse.pm
t/hooks/TestHooks authz.pm init.pm
t/response/TestModperl current_callback.pm
Log:
remove the second-guessing code that was trying to guess the package
name to load from the handler configuration (by stripping ::string and
trying to load the package). fall back to using explicit PerlModule to
load modules whose handler sub name is not called 'handler' + adjust
tests.
Revision Changes Path
1.160 +6 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -r1.159 -r1.160
--- Changes 25 Mar 2003 07:52:22 -0000 1.159
+++ Changes 31 Mar 2003 01:50:51 -0000 1.160
@@ -10,6 +10,12 @@
=item 1.99_09-dev
+remove the second-guessing code that was trying to guess the package
+name to load from the handler configuration (by stripping ::string and
+trying to load the package). fall back to using explicit PerlModule to
+load modules whose handler sub name is not called 'handler' + adjust
+tests. [Stas]
+
set the magic taint flags before modules are required [Stas]
make sure to set base server's mip before any of the
1.23 +2 -47 modperl-2.0/src/modules/perl/modperl_mgv.c
Index: modperl_mgv.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- modperl_mgv.c 24 Jan 2003 05:09:39 -0000 1.22
+++ modperl_mgv.c 31 Mar 2003 01:50:51 -0000 1.23
@@ -265,53 +265,8 @@
}
}
else {
- I32 errlen = 0;
- char *errpv;
- int ix = ap_rind(name, ':');
- stash = Nullhv;
-
- /* last guess: Perl*Handler is a fully qualified subroutine name
- * but its module was not loaded
- * XXX: This guess may incorrectly pick the wrong module,
- * e.g. if Apache::Foo is not found, Apache will be picked
- */
- if (ix != -1) {
- /* split Foo::Bar::baz into Foo::Bar, baz */
- char *try_package = apr_pstrndup(p, name, ix-1);
- handler_name = apr_pstrdup(p, name + ix + 1);
-
- /* if this fails we want to log $@ from failure above */
- errlen = SvCUR(ERRSV);
- errpv = apr_pstrndup(p, SvPVX(ERRSV), errlen);
-
- if (modperl_require_module(aTHX_ try_package, FALSE)) {
- MP_TRACE_h(MP_FUNC, "loaded %s package\n", try_package);
- stash = gv_stashpv(try_package, FALSE);
- }
- else {
- /* however, if require has failed and the error
- * wasn't "Can't locate ... in @INC", we did find
- * the package, and there is a problem with it
- */
- if (!(strnEQ(SvPVX(ERRSV), "Can't locate", 12)
- && ap_strstr(SvPVX(ERRSV), "in @INC"))) {
- errlen = SvCUR(ERRSV);
- errpv = apr_pstrndup(p, SvPVX(ERRSV), errlen);
- }
- }
- }
-
- if (!stash) {
- if (errlen) {
- sv_setpvn(ERRSV, errpv, errlen);
- }
- if (logfailure) {
- (void)modperl_errsv(aTHX_ HTTP_INTERNAL_SERVER_ERROR,
- NULL, NULL);
- }
- MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
- return 0;
- }
+ MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
+ return 0;
}
}
1.4 +2 -1 modperl-2.0/t/filter/TestFilter/both_str_con_add.pm
Index: both_str_con_add.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/both_str_con_add.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- both_str_con_add.pm 4 Feb 2003 23:52:37 -0000 1.3
+++ both_str_con_add.pm 31 Mar 2003 01:50:51 -0000 1.4
@@ -79,7 +79,8 @@
__END__
<NoAutoConfig>
<VirtualHost TestFilter::both_str_con_add>
- PerlPreConnectionHandler TestFilter::both_str_con_add::pre_connection
+ PerlModule TestFilter::both_str_con_add
+ PerlPreConnectionHandler TestFilter::both_str_con_add::pre_connection
PerlProcessConnectionHandler TestFilter::both_str_con_add
</VirtualHost>
</NoAutoConfig>
1.3 +2 -1 modperl-2.0/t/filter/TestFilter/both_str_rec_add.pm
Index: both_str_rec_add.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/both_str_rec_add.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- both_str_rec_add.pm 25 Jan 2003 03:08:05 -0000 1.2
+++ both_str_rec_add.pm 31 Mar 2003 01:50:51 -0000 1.3
@@ -58,8 +58,9 @@
1;
__DATA__
<NoAutoConfig>
+ PerlModule TestFilter::both_str_rec_add
<Location /TestFilter::both_str_rec_add>
- SetHandler modperl
+ SetHandler modperl
PerlHeaderParserHandler TestFilter::both_str_rec_add::header_parser
PerlResponseHandler TestFilter::both_str_rec_add
</Location>
1.2 +1 -0 modperl-2.0/t/filter/TestFilter/in_bbs_body.pm
Index: in_bbs_body.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_bbs_body.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- in_bbs_body.pm 15 Jan 2003 06:47:15 -0000 1.1
+++ in_bbs_body.pm 31 Mar 2003 01:50:51 -0000 1.2
@@ -75,4 +75,5 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::in_bbs_body
PerlResponseHandler TestFilter::in_bbs_body::response
1.4 +1 -0 modperl-2.0/t/filter/TestFilter/in_str_consume.pm
Index: in_str_consume.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_str_consume.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- in_str_consume.pm 25 Jan 2003 03:08:05 -0000 1.3
+++ in_str_consume.pm 31 Mar 2003 01:50:51 -0000 1.4
@@ -65,4 +65,5 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::in_str_consume
PerlResponseHandler TestFilter::in_str_consume::response
1.5 +1 -0 modperl-2.0/t/filter/TestFilter/in_str_declined.pm
Index: in_str_declined.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_str_declined.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- in_str_declined.pm 21 Mar 2003 01:05:53 -0000 1.4
+++ in_str_declined.pm 31 Mar 2003 01:50:51 -0000 1.5
@@ -57,5 +57,6 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::in_str_declined
PerlResponseHandler TestFilter::in_str_declined::response
1.3 +1 -0 modperl-2.0/t/filter/TestFilter/in_str_lc.pm
Index: in_str_lc.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_str_lc.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- in_str_lc.pm 25 Jan 2003 03:08:05 -0000 1.2
+++ in_str_lc.pm 31 Mar 2003 01:50:51 -0000 1.3
@@ -34,4 +34,5 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::in_str_lc
PerlResponseHandler TestFilter::in_str_lc::response
1.3 +1 -0 modperl-2.0/t/filter/TestFilter/in_str_sandwich.pm
Index: in_str_sandwich.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_str_sandwich.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- in_str_sandwich.pm 25 Jan 2003 03:08:05 -0000 1.2
+++ in_str_sandwich.pm 31 Mar 2003 01:50:51 -0000 1.3
@@ -48,4 +48,5 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::in_str_sandwich
PerlResponseHandler TestFilter::in_str_sandwich::response
1.2 +1 -0 modperl-2.0/t/filter/TestFilter/out_bbs_basic.pm
Index: out_bbs_basic.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_bbs_basic.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- out_bbs_basic.pm 15 Jan 2003 06:47:15 -0000 1.1
+++ out_bbs_basic.pm 31 Mar 2003 01:50:51 -0000 1.2
@@ -65,4 +65,5 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::out_bbs_basic
PerlResponseHandler TestFilter::out_bbs_basic::response
1.4 +1 -1 modperl-2.0/t/filter/TestFilter/out_bbs_ctx.pm
Index: out_bbs_ctx.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_bbs_ctx.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- out_bbs_ctx.pm 3 Mar 2003 03:39:06 -0000 1.3
+++ out_bbs_ctx.pm 31 Mar 2003 01:50:51 -0000 1.4
@@ -100,7 +100,7 @@
1;
__DATA__
-
SetHandler modperl
+PerlModule TestFilter::out_bbs_ctx
PerlResponseHandler TestFilter::out_bbs_ctx::response
1.2 +1 -0 modperl-2.0/t/filter/TestFilter/out_str_api.pm
Index: out_str_api.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_str_api.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- out_str_api.pm 15 Jan 2003 06:47:15 -0000 1.1
+++ out_str_api.pm 31 Mar 2003 01:50:51 -0000 1.2
@@ -66,4 +66,5 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::out_str_api
PerlResponseHandler TestFilter::out_str_api::response
1.3 +1 -0 modperl-2.0/t/filter/TestFilter/out_str_ctx.pm
Index: out_str_ctx.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_str_ctx.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- out_str_ctx.pm 3 Mar 2003 03:39:06 -0000 1.2
+++ out_str_ctx.pm 31 Mar 2003 01:50:51 -0000 1.3
@@ -89,5 +89,6 @@
__DATA__
SetHandler modperl
+PerlModule TestFilter::out_str_ctx
PerlResponseHandler TestFilter::out_str_ctx::response
1.2 +1 -0 modperl-2.0/t/filter/TestFilter/out_str_declined.pm
Index: out_str_declined.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_str_declined.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- out_str_declined.pm 3 Mar 2003 03:42:06 -0000 1.1
+++ out_str_declined.pm 31 Mar 2003 01:50:51 -0000 1.2
@@ -75,6 +75,7 @@
1;
__DATA__
SetHandler modperl
+PerlModule TestFilter::out_str_declined
PerlResponseHandler TestFilter::out_str_declined::response
PerlOutputFilterHandler TestFilter::out_str_declined::decline
PerlOutputFilterHandler TestFilter::out_str_declined::black_hole
1.3 +1 -0 modperl-2.0/t/filter/TestFilter/out_str_reverse.pm
Index: out_str_reverse.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_str_reverse.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- out_str_reverse.pm 5 Mar 2003 09:13:18 -0000 1.2
+++ out_str_reverse.pm 31 Mar 2003 01:50:51 -0000 1.3
@@ -59,6 +59,7 @@
1;
__DATA__
<Base>
+ PerlModule TestFilter::out_str_reverse
<LocationMatch "/filter/reverse.txt">
PerlOutputFilterHandler TestFilter::out_str_reverse
</LocationMatch>
1.3 +1 -0 modperl-2.0/t/hooks/TestHooks/authz.pm
Index: authz.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/authz.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- authz.pm 11 Apr 2002 11:08:43 -0000 1.2
+++ authz.pm 31 Mar 2003 01:50:52 -0000 1.3
@@ -40,6 +40,7 @@
require user dougm
AuthType Basic
AuthName simple
+PerlModule TestHooks::authz
PerlAuthenHandler TestHooks::authz::auth_any
PerlResponseHandler Apache::TestHandler::ok1
SetHandler modperl
1.4 +1 -0 modperl-2.0/t/hooks/TestHooks/init.pm
Index: init.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/init.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- init.pm 18 May 2002 02:02:32 -0000 1.3
+++ init.pm 31 Mar 2003 01:50:52 -0000 1.4
@@ -56,6 +56,7 @@
__DATA__
PerlInitHandler TestHooks::init::second
<Base>
+ PerlModule TestHooks::init
PerlInitHandler TestHooks::init::first
</Base>
PerlResponseHandler TestHooks::init
1.3 +1 -0 modperl-2.0/t/response/TestModperl/current_callback.pm
Index: current_callback.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/current_callback.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- current_callback.pm 8 Mar 2003 08:56:19 -0000 1.2
+++ current_callback.pm 31 Mar 2003 01:50:52 -0000 1.3
@@ -40,6 +40,7 @@
1;
__DATA__
+PerlModule TestModperl::current_callback
PerlHeaderParserHandler TestModperl::current_callback::headerparser
PerlFixupHandler TestModperl::current_callback::fixup
PerlResponseHandler TestModperl::current_callback