perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/src/modules/perl modperl_mgv.c
Date Mon, 02 Apr 2001 07:37:13 GMT
dougm       01/04/02 00:37:13

  Modified:    src/modules/perl modperl_mgv.c
  Log:
  one more guess to resolve undefined Perl*Handlers
  
  Revision  Changes    Path
  1.12      +21 -2     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- modperl_mgv.c	2001/03/26 01:08:29	1.11
  +++ modperl_mgv.c	2001/04/02 07:37:12	1.12
  @@ -299,8 +299,27 @@
               }
           }
           else {
  -            MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
  -            return 0;
  +            int ix = ap_rind(name, ':');
  +            stash = Nullhv;
  +
  +            /* last guess: Perl*Handler is a fully qualified subroutine name
  +             * but its module was not loaded
  +             */
  +            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 (modperl_require_module(aTHX_ try_package)) {
  +                    MP_TRACE_h(MP_FUNC, "loaded %s package\n", try_package);
  +                    stash = gv_stashpv(try_package, FALSE);
  +                }
  +            }
  +
  +            if (!stash) {
  +                MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
  +                return 0;
  +            }
           }
       }
   
  
  
  

Mime
View raw message