httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@hyperreal.org
Subject cvs commit: apache-2.0/mpm/src/modules/standard mod_alias.c mod_setenvif.c mod_userdir.c
Date Sun, 11 Jul 1999 16:54:10 GMT
ben         99/07/11 09:54:10

  Modified:    mpm/src/ap ap_hooks.c
               mpm/src/include ap_hooks.h
               mpm/src/main http_core.c
               mpm/src/modules/standard mod_alias.c mod_setenvif.c
                        mod_userdir.c
  Log:
  Add non-topological ordering for hooks.
  
  Revision  Changes    Path
  1.2       +10 -0     apache-2.0/mpm/src/ap/ap_hooks.c
  
  Index: ap_hooks.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/ap_hooks.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ap_hooks.c	1999/07/11 13:27:23	1.1
  +++ ap_hooks.c	1999/07/11 16:54:00	1.2
  @@ -13,6 +13,7 @@
       const char *szName;
       const char * const *aszPredecessors;
       const char * const *aszSuccessors;
  +    int nOrder;
       } TSortData;
   
   typedef struct tsort_
  @@ -23,11 +24,20 @@
       struct tsort_ *pNext;
       } TSort;
   
  +static int crude_order(const void *a_,const void *b_)
  +    {
  +    const TSortData *a=a_;
  +    const TSortData *b=b_;
  +
  +    return a->nOrder-b->nOrder;
  +    }
  +
   static TSort *prepare(pool *p,TSortData *pItems,int nItems)
       {
       TSort *pData=ap_palloc(p,nItems*sizeof *pData);
       int n;
   
  +    qsort(pItems,nItems,sizeof *pItems,crude_order);
       for(n=0 ; n < nItems ; ++n)
   	{
   	pData[n].nPredecessors=0;
  
  
  
  1.7       +13 -2     apache-2.0/mpm/src/include/ap_hooks.h
  
  Index: ap_hooks.h
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/mpm/src/include/ap_hooks.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ap_hooks.h	1999/07/11 16:42:23	1.6
  +++ ap_hooks.h	1999/07/11 16:54:02	1.7
  @@ -3,7 +3,8 @@
   
   #define DECLARE_HOOK(ret,name,args) \
   typedef ret HOOK_##name args; \
  -void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre,const char * const *aszSucc);
\
  +void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
  +		    const char * const *aszSucc,int nOrder); \
   ret ap_run_##name args; \
   typedef struct _LINK_##name \
       { \
  @@ -11,6 +12,7 @@
       const char *szName; \
       const char * const *aszPredecessors; \
       const char * const *aszSuccessors; \
  +    int nOrder; \
       } LINK_##name;
   
   #define HOOK_STRUCT(members) \
  @@ -20,7 +22,8 @@
       array_header *link_##name;
   
   #define IMPLEMENT_HOOK_BASE(ret,rv_decl,sv,rv,name,args,args2,run_all,term1,term2,rv_final)
\
  -void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre,const char * const *aszSucc)
\
  +void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
  +		    const char * const *aszSucc,int nOrder) \
       { \
       LINK_##name *pHook; \
       if(!_hooks.link_##name) \
  @@ -32,6 +35,7 @@
       pHook->pFunc=pf; \
       pHook->aszPredecessors=aszPre; \
       pHook->aszSuccessors=aszSucc; \
  +    pHook->nOrder=nOrder; \
       pHook->szName=g_szCurrentHookName; \
       if(g_bDebugHooks) \
   	ap_show_hook(#name,aszPre,aszSucc); \
  @@ -63,6 +67,13 @@
   	IMPLEMENT_HOOK_BASE(ret,ret r_;,r_=,r_,name,args,args2,run_all,r_ != decline,r_ != ok,run_all
? ok : decline)
   #define IMPLEMENT_VOID_HOOK(name,args,args2,run_all) \
   	IMPLEMENT_HOOK_BASE(void,,,,name,args,args2,run_all,1,0,)
  +
  +     /* Hook orderings */
  +#define HOOK_REALLY_FIRST	(-10)
  +#define HOOK_FIRST		0
  +#define HOOK_MIDDLE		10
  +#define HOOK_LAST		20
  +#define HOOK_REALLY_LAST	30
   
   extern pool *g_pHookPool;
   extern int g_bDebugHooks;
  
  
  
  1.5       +1 -1      apache-2.0/mpm/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_core.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- http_core.c	1999/07/11 13:27:25	1.4
  +++ http_core.c	1999/07/11 16:54:04	1.5
  @@ -2631,7 +2631,7 @@
   
   static void register_hooks()
       {
  -    ap_hook_translate_name(core_translate,NULL,NULL);
  +    ap_hook_translate_name(core_translate,NULL,NULL,HOOK_REALLY_LAST);
       }
   
   API_VAR_EXPORT module core_module = {
  
  
  
  1.5       +1 -1      apache-2.0/mpm/src/modules/standard/mod_alias.c
  
  Index: mod_alias.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_alias.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_alias.c	1999/07/11 13:27:28	1.4
  +++ mod_alias.c	1999/07/11 16:54:08	1.5
  @@ -399,7 +399,7 @@
       {
       static const char * const aszPre[]={ "mod_userdir.c",NULL };
   
  -    ap_hook_translate_name(translate_alias_redir,aszPre,NULL);
  +    ap_hook_translate_name(translate_alias_redir,aszPre,NULL,HOOK_MIDDLE);
       }
   
   module MODULE_VAR_EXPORT alias_module =
  
  
  
  1.5       +1 -1      apache-2.0/mpm/src/modules/standard/mod_setenvif.c
  
  Index: mod_setenvif.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_setenvif.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_setenvif.c	1999/07/11 13:27:29	1.4
  +++ mod_setenvif.c	1999/07/11 16:54:08	1.5
  @@ -402,7 +402,7 @@
   
   static void register_hooks()
       {
  -    ap_hook_post_read_request(match_headers,NULL,NULL);
  +    ap_hook_post_read_request(match_headers,NULL,NULL,HOOK_MIDDLE);
       }
   
   module MODULE_VAR_EXPORT setenvif_module =
  
  
  
  1.5       +1 -1      apache-2.0/mpm/src/modules/standard/mod_userdir.c
  
  Index: mod_userdir.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_userdir.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_userdir.c	1999/07/11 13:27:29	1.4
  +++ mod_userdir.c	1999/07/11 16:54:08	1.5
  @@ -331,7 +331,7 @@
       {
       static const char * const aszSucc[]={ "mod_alias.c",NULL };
   
  -    ap_hook_translate_name(translate_userdir,NULL,aszSucc);
  +    ap_hook_translate_name(translate_userdir,NULL,aszSucc,HOOK_MIDDLE);
       }
   
   module userdir_module = {
  
  
  

Mime
View raw message