dougm       01/03/14 18:17:36

  Modified:    src/modules/perl mod_perl.c modperl_apache_includes.h
                        modperl_config.c modperl_interp.c modperl_types.h
  Log:
  if mpm is not threaded, dont create any clones, use the server parent Perl to serve 
requests
  
  Revision  Changes    Path
  1.35      +6 -1      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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- mod_perl.c        2001/03/15 01:55:44     1.34
  +++ mod_perl.c        2001/03/15 02:17:35     1.35
  @@ -139,10 +139,15 @@
   #ifdef USE_ITHREADS
   static void modperl_init_clones(server_rec *s, apr_pool_t *p)
   {
  -#ifdef MP_TRACE
       modperl_srv_config_t *base_scfg = modperl_srv_config_get(s);
  +#ifdef MP_TRACE
       char *base_name = modperl_server_desc(s, p);
   #endif /* MP_TRACE */
  +
  +    if (!base_scfg->threaded_mpm) {
  +        MP_TRACE_i(MP_FUNC, "no clones created for non-threaded mpm\n");
  +        return;
  +    }
   
       for (; s; s=s->next) {
           MP_dSCFG(s);
  
  
  
  1.4       +1 -0      modperl-2.0/src/modules/perl/modperl_apache_includes.h
  
  Index: modperl_apache_includes.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_apache_includes.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- modperl_apache_includes.h 2001/02/28 05:35:08     1.3
  +++ modperl_apache_includes.h 2001/03/15 02:17:35     1.4
  @@ -16,6 +16,7 @@
   #include "http_request.h"
   #include "http_connection.h"
   #include "http_core.h"
  +#include "ap_mpm.h"
   
   #include "apr_lock.h"
   #include "apr_strings.h"
  
  
  
  1.21      +2 -0      modperl-2.0/src/modules/perl/modperl_config.c
  
  Index: modperl_config.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- modperl_config.c  2001/03/14 08:22:48     1.20
  +++ modperl_config.c  2001/03/15 02:17:35     1.21
  @@ -129,6 +129,8 @@
       modperl_srv_config_t *scfg = modperl_srv_config_new(p);
   
   #ifdef USE_ITHREADS
  +    ap_mpm_query(AP_MPMQ_IS_THREADED, &scfg->threaded_mpm);
  +
       scfg->interp_pool_cfg = 
           (modperl_tipool_config_t *)
           apr_pcalloc(p, sizeof(*scfg->interp_pool_cfg));
  
  
  
  1.23      +9 -2      modperl-2.0/src/modules/perl/modperl_interp.c
  
  Index: modperl_interp.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_interp.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- modperl_interp.c  2001/03/14 08:22:48     1.22
  +++ modperl_interp.c  2001/03/15 02:17:35     1.23
  @@ -212,14 +212,21 @@
       apr_pool_t *p = NULL;
       request_rec *r = rr;
       int is_subrequest = (rr && rr->main) ? 1 : 0;
  +    modperl_interp_lifetime_e lifetime;
   
  +    if (!scfg->threaded_mpm) {
  +        MP_TRACE_i(MP_FUNC, "using parent 0x%lx for non-threaded mpm\n",
  +                   (unsigned long)scfg->mip->parent);
  +        return scfg->mip->parent;
  +    }
  +
       /*
        * if a per-dir PerlInterpLifetime is specified, use it.
        * else if r != NULL use per-server PerlInterpLifetime
        * else lifetime must be per-connection
        */
  -    modperl_interp_lifetime_e lifetime = 
  -        (dcfg && !modperl_interp_lifetime_undef(dcfg)) ? 
  +
  +    lifetime = (dcfg && !modperl_interp_lifetime_undef(dcfg)) ? 
           dcfg->interp_lifetime :
           (r ? scfg->interp_lifetime : MP_INTERP_LIFETIME_CONNECTION);
   
  
  
  
  1.25      +1 -0      modperl-2.0/src/modules/perl/modperl_types.h
  
  Index: modperl_types.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- modperl_types.h   2001/03/14 08:22:48     1.24
  +++ modperl_types.h   2001/03/15 02:17:35     1.25
  @@ -128,6 +128,7 @@
       modperl_interp_pool_t *mip;
       modperl_tipool_config_t *interp_pool_cfg;
       modperl_interp_lifetime_e interp_lifetime;
  +    int threaded_mpm;
   #else
       PerlInterpreter *perl;
   #endif
  
  
  

Reply via email to