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 mod_perl.c mod_perl.h
Date Sat, 24 Aug 2002 16:02:40 GMT
dougm       2002/08/24 09:02:40

  Modified:    src/modules/perl mod_perl.c mod_perl.h
  Log:
  add modperl_run() function for things that need to init modperl before
  the post_config phase, e.g. <Perl> sections and directive handlers.
  
  Revision  Changes    Path
  1.132     +20 -0     modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.131
  retrieving revision 1.132
  diff -u -r1.131 -r1.132
  --- mod_perl.c	11 Jul 2002 02:06:11 -0000	1.131
  +++ mod_perl.c	24 Aug 2002 16:02:39 -0000	1.132
  @@ -367,9 +367,15 @@
       return APR_SUCCESS;
   }
   
  +static int MP_init_done = 0;
  +
   int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
                         apr_pool_t *ptemp, server_rec *s)
   {
  +    if (MP_init_done++ > 0) {
  +        return OK;
  +    }
  +
       apr_pool_create(&server_pool, pconf);
   
       modperl_sys_init();
  @@ -379,6 +385,20 @@
       modperl_init(s, pconf);
   
       return OK;
  +}
  +
  +/*
  + * if we need to init earlier than post_config,
  + * e.g. <Perl> sections or directive handlers.
  + */
  +/*
  + * XXX: this probably won't work well if called from a
  + * vhost rather than the base config if modperl_hook_init
  + * hasn't been run first from the base config.
  + */
  +int modperl_run(apr_pool_t *p, server_rec *s)
  +{
  +    return modperl_hook_init(p, NULL, NULL, s);
   }
   
   int modperl_hook_pre_config(apr_pool_t *p, apr_pool_t *plog,
  
  
  
  1.49      +1 -0      modperl-2.0/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- mod_perl.h	21 Jun 2002 00:05:49 -0000	1.48
  +++ mod_perl.h	24 Aug 2002 16:02:39 -0000	1.49
  @@ -68,6 +68,7 @@
   #include "modperl_perl.h"
   
   void modperl_init(server_rec *s, apr_pool_t *p);
  +int modperl_run(apr_pool_t *p, server_rec *s);
   int modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
                         apr_pool_t *ptemp, server_rec *s);
   int modperl_hook_pre_config(apr_pool_t *p, apr_pool_t *plog,
  
  
  

Mime
View raw message