stas 2003/01/05 21:12:38
Modified: src/modules/perl modperl_mgv.c
. Changes
Log:
Log the real error message when Foo::Bar::sub_name fails to resolve,
because of a problem in Foo::Bar, when Foo::Bar *was* found
This should finally show the real problems with bug reports from people
getting "Can't locate TestHooks::init::first" when the file is there
Revision Changes Path
1.21 +13 -1 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.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- modperl_mgv.c 6 Dec 2002 08:00:21 -0000 1.20
+++ modperl_mgv.c 6 Jan 2003 05:12:37 -0000 1.21
@@ -272,7 +272,9 @@
/* 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);
@@ -285,6 +287,16 @@
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 ...", we did find the
+ * package, and there is a problem with it
+ */
+ if (strnNE(SvPVX(ERRSV), "Can't locate", 12)) {
+ errlen = SvCUR(ERRSV);
+ errpv = apr_pstrndup(p, SvPVX(ERRSV), errlen);
+ }
}
}
1.93 +3 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- Changes 1 Jan 2003 03:48:20 -0000 1.92
+++ Changes 6 Jan 2003 05:12:38 -0000 1.93
@@ -10,6 +10,9 @@
=item 1.99_08-dev
+Log the real error message when Foo::Bar::sub_name fails to resolve,
+because of a problem in Foo::Bar, when Foo::Bar *was* found [Stas]
+
Add PerlPreConnectionHandler support in Apache::Test [Stas]
Enable PerlPreConnectionHandler [Stas]