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_callback.c modperl_handler.c modperl_handler.h
Date Thu, 19 Apr 2001 17:57:17 GMT
dougm       01/04/19 10:57:17

  Modified:    src/modules/perl modperl_callback.c modperl_handler.c
                        modperl_handler.h
  Log:
  move handler resolver code into modperl_handler_resolve routine
  
  Revision  Changes    Path
  1.41      +3 -34     modperl-2.0/src/modules/perl/modperl_callback.c
  
  Index: modperl_callback.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- modperl_callback.c	2001/04/13 01:10:20	1.40
  +++ modperl_callback.c	2001/04/19 17:57:14	1.41
  @@ -6,41 +6,10 @@
       CV *cv=Nullcv;
       I32 flags = G_EVAL|G_SCALAR;
       dSP;
  -    int count, status, duped=0;
  +    int count, status;
   
  -#ifdef USE_ITHREADS
  -    if (p && !MpHandlerPARSED(handler) && !MpHandlerDYNAMIC(handler)) {
  -        MP_dSCFG(s);
  -        if (scfg->threaded_mpm) {
  -            /*
  -             * cannot update the handler structure at request time without
  -             * locking, so just copy it
  -             */
  -            handler = modperl_handler_dup(p, handler);
  -            duped = 1;
  -        }
  -    }
  -#endif
  -
  -    MP_TRACE_h_do(MpHandler_dump_flags(handler, handler->name));
  -
  -    if (!MpHandlerPARSED(handler)) {
  -        apr_pool_t *rp = duped ? p : s->process->pconf;
  -        MpHandlerAUTOLOAD_On(handler);
  -
  -        MP_TRACE_h(MP_FUNC,
  -                   "handler %s was not compiled at startup, "
  -                   "attempting to resolve using %s pool 0x%lx\n",
  -                   handler->name,
  -                   duped ? "current" : "server conf",
  -                   (unsigned long)rp);
  -
  -        if (!modperl_mgv_resolve(aTHX_ handler, rp, handler->name)) {
  -            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, 
  -                         "failed to resolve handler `%s'",
  -                         handler->name);
  -            return HTTP_INTERNAL_SERVER_ERROR;
  -        }
  +    if ((status = modperl_handler_resolve(aTHX_ &handler, p, s)) != OK) {
  +        return status;
       }
   
       ENTER;SAVETMPS;
  
  
  
  1.9       +44 -0     modperl-2.0/src/modules/perl/modperl_handler.c
  
  Index: modperl_handler.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modperl_handler.c	2001/04/12 03:24:45	1.8
  +++ modperl_handler.c	2001/04/19 17:57:15	1.9
  @@ -11,6 +11,50 @@
       return handler;
   }
   
  +int modperl_handler_resolve(pTHX_ modperl_handler_t **handp,
  +                            apr_pool_t *p, server_rec *s)
  +{
  +    int duped=0;
  +    modperl_handler_t *handler = *handp;
  +
  +#ifdef USE_ITHREADS
  +    if (p && !MpHandlerPARSED(handler) && !MpHandlerDYNAMIC(handler)) {
  +        MP_dSCFG(s);
  +        if (scfg->threaded_mpm) {
  +            /*
  +             * cannot update the handler structure at request time without
  +             * locking, so just copy it
  +             */
  +            handler = *handp = modperl_handler_dup(p, handler);
  +            duped = 1;
  +        }
  +    }
  +#endif
  +
  +    MP_TRACE_h_do(MpHandler_dump_flags(handler, handler->name));
  +
  +    if (!MpHandlerPARSED(handler)) {
  +        apr_pool_t *rp = duped ? p : s->process->pconf;
  +        MpHandlerAUTOLOAD_On(handler);
  +
  +        MP_TRACE_h(MP_FUNC,
  +                   "handler %s was not compiled at startup, "
  +                   "attempting to resolve using %s pool 0x%lx\n",
  +                   handler->name,
  +                   duped ? "current" : "server conf",
  +                   (unsigned long)rp);
  +
  +        if (!modperl_mgv_resolve(aTHX_ handler, rp, handler->name)) {
  +            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, 
  +                         "failed to resolve handler `%s'",
  +                         handler->name);
  +            return HTTP_INTERNAL_SERVER_ERROR;
  +        }
  +    }
  +
  +    return OK;
  +}
  +
   modperl_handler_t *modperl_handler_dup(apr_pool_t *p,
                                          modperl_handler_t *h)
   {
  
  
  
  1.7       +3 -0      modperl-2.0/src/modules/perl/modperl_handler.h
  
  Index: modperl_handler.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- modperl_handler.h	2001/03/26 01:08:29	1.6
  +++ modperl_handler.h	2001/04/19 17:57:15	1.7
  @@ -21,6 +21,9 @@
   
   modperl_handler_t *modperl_handler_new(apr_pool_t *p, const char *name);
   
  +int modperl_handler_resolve(pTHX_ modperl_handler_t **handp,
  +                            apr_pool_t *p, server_rec *s);
  +
   modperl_handler_t *modperl_handler_dup(apr_pool_t *p,
                                          modperl_handler_t *h);
   
  
  
  

Mime
View raw message