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 modperl_global.c modperl_global.h modperl_util.c
Date Fri, 04 May 2001 05:49:20 GMT
dougm       01/05/03 22:49:20

  Modified:    src/modules/perl mod_perl.c modperl_global.c
                        modperl_global.h modperl_util.c
  Log:
  add globals for server_rec and threaded_mpm
  
  Revision  Changes    Path
  1.52      +9 -3      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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- mod_perl.c	2001/04/30 04:38:34	1.51
  +++ mod_perl.c	2001/05/04 05:49:19	1.52
  @@ -207,15 +207,22 @@
   }
   #endif /* USE_ITHREADS */
   
  -static void modperl_init_globals(apr_pool_t *pconf)
  +static void modperl_init_globals(server_rec *s, apr_pool_t *pconf)
   {
  -    modperl_global_init_pconf(pconf, (void *)pconf);
  +    int threaded_mpm;
  +    ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm);
  +
  +    modperl_global_init_pconf(pconf, pconf);
  +    modperl_global_init_threaded_mpm(pconf, threaded_mpm);
  +    modperl_global_init_server_rec(pconf, s);
  +
       modperl_tls_create_request_rec(pconf);
   }
   
   void modperl_hook_init(apr_pool_t *pconf, apr_pool_t *plog, 
                          apr_pool_t *ptemp, server_rec *s)
   {
  +    modperl_init_globals(s, pconf);
       modperl_init(s, pconf);
   }
   
  @@ -243,7 +250,6 @@
       ap_add_version_component(pconf,
                                Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel));
       modperl_mgv_hash_handlers(pconf, s);
  -    modperl_init_globals(pconf);
   #ifdef USE_ITHREADS
       modperl_init_clones(s, pconf);
   #endif
  
  
  
  1.3       +6 -0      modperl-2.0/src/modules/perl/modperl_global.c
  
  Index: modperl_global.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_global.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- modperl_global.c	2001/05/01 02:01:02	1.2
  +++ modperl_global.c	2001/05/04 05:49:19	1.3
  @@ -126,6 +126,8 @@
   }                                                        \
   
   MP_GLOBAL_IMPL(pconf, apr_pool_t *);
  +MP_GLOBAL_IMPL(server_rec, server_rec *);
  +MP_GLOBAL_IMPL(threaded_mpm, int);
   
   #if MP_THREADED
   static apr_status_t modperl_tls_cleanup(void *data)
  @@ -151,6 +153,10 @@
   apr_status_t modperl_tls_get(modperl_tls_t *key, void **data)
   {
   #if MP_THREADED
  +    if (!key) {
  +        *data = NULL;
  +        return APR_SUCCESS;
  +    }
       return apr_threadkey_private_get(data, key);
   #else
       *data = modperl_global_get((modperl_global_t *)key);
  
  
  
  1.3       +2 -0      modperl-2.0/src/modules/perl/modperl_global.h
  
  Index: modperl_global.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_global.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- modperl_global.h	2001/05/01 01:53:52	1.2
  +++ modperl_global.h	2001/05/04 05:49:19	1.3
  @@ -41,6 +41,8 @@
   void modperl_global_set_##gname(void *)
   
   MP_GLOBAL_DECL(pconf, apr_pool_t *);
  +MP_GLOBAL_DECL(server_rec, server_rec *);
  +MP_GLOBAL_DECL(threaded_mpm, int);
   
   apr_status_t modperl_tls_create(apr_pool_t *p, modperl_tls_t **key);
   apr_status_t modperl_tls_get(modperl_tls_t *key, void **data);
  
  
  
  1.13      +4 -0      modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- modperl_util.c	2001/05/04 04:11:32	1.12
  +++ modperl_util.c	2001/05/04 05:49:19	1.13
  @@ -90,6 +90,10 @@
           (void)modperl_tls_get_request_rec(&r);
   
           if (!r) {
  +            if (classname && SvPOK(in) && !strEQ(classname, SvPVX(in)))
{
  +                /* might be Apache::{Server,RequestRec}-> dual method */
  +                return NULL;
  +            }
               Perl_croak(aTHX_
                          "Apache->%s called without setting Apache->request!",
                          cv ? GvNAME(CvGV(cv)) : "unknown");
  
  
  

Mime
View raw message