Geoffrey Young wrote:
 -            if (modperl_require_module(aTHX_ name, FALSE)) {
 +            if (modperl_require_module(aTHX_ name, logfailure)) {
                  MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);
              }
              else {
 -                MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
 -                return 0;
 +                Perl_croak(aTHX_ "failed to load %s package\n", name);


there is a problem here if a module contains syntax errors but is not loaded
with PerlModule.

before, the modperl_mgv_resolve would return 0 and the ERRSV was caught in
modperl_callback, where it was propagated to the error_log.

now what happens is that it merely fails with the croak message, with no
corresponding ERRSV in the logs to help users figure it out.

the only place where logfailure is FALSE is in modperl_handler_resolve,
which is called from modperl_callback.  I can't see the reason for this
being false here, except that maybe the logs haven't been opened yet for
very early callbacks?  but regardless, this needs to be fixed.

Good catch, Geoff! How about this:


Index: src/modules/perl/modperl_mgv.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v
retrieving revision 1.32
diff -u -r1.32 modperl_mgv.c
--- src/modules/perl/modperl_mgv.c      9 Feb 2004 19:32:42 -0000       1.32
+++ src/modules/perl/modperl_mgv.c      10 Feb 2004 17:15:25 -0000
@@ -277,7 +277,15 @@
                 MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);
             }
             else {
-                Perl_croak(aTHX_ "failed to load %s package\n", name);
+                /* the caller doesn't handle the error checking */
+                if (logfailure) {
+                    Perl_croak(aTHX_ "failed to load %s package\n", name);
+                }
+                else {
+                    /* the caller handles the error checking */
+                    MP_TRACE_h(MP_FUNC, "failied to load %s package\n", name);
+                    return 0;
+                }
             }
         }
         else {

may be we should add a test that catches this case.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to