You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by be...@hyperreal.org on 1999/07/11 15:27:32 UTC
cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c mod_userdir.c
ben 99/07/11 06:27:32
Modified: mpm/src/ap Makefile.tmpl
mpm/src/include ap_hooks.h http_config.h http_request.h
mpm/src/main http_config.c http_core.c http_request.c
mpm/src/modules/mpm/prefork prefork.c
mpm/src/modules/standard mod_access.c mod_alias.c mod_asis.c
mod_auth.c mod_autoindex.c mod_dir.c mod_env.c
mod_imap.c mod_log_config.c mod_mime.c
mod_negotiation.c mod_setenvif.c mod_userdir.c
Added: mpm/src/ap ap_hooks.c
Log:
Add topological sorting to hook ordering.
Revision Changes Path
1.6 +1 -1 apache-2.0/mpm/src/ap/Makefile.tmpl
Index: Makefile.tmpl
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/ap/Makefile.tmpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile.tmpl 1999/06/29 09:00:06 1.5
+++ Makefile.tmpl 1999/07/11 13:27:23 1.6
@@ -6,7 +6,7 @@
LIB=libap.a
OBJS=ap_cpystrn.o ap_execve.o ap_fnmatch.o ap_getpass.o ap_md5c.o ap_signal.o \
- ap_slack.o ap_snprintf.o ap_buf.o
+ ap_slack.o ap_snprintf.o ap_buf.o ap_hooks.o
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $<
1.1 apache-2.0/mpm/src/ap/ap_hooks.c
Index: ap_hooks.c
===================================================================
#include "httpd.h"
#include "ap_hooks.h"
#include <assert.h>
#if 0
#define ap_palloc(pool,size) malloc(size)
#endif
/* NB: This must echo the LINK_##name structure */
typedef struct
{
void (*dummy)(void *);
const char *szName;
const char * const *aszPredecessors;
const char * const *aszSuccessors;
} TSortData;
typedef struct tsort_
{
void *pData;
int nPredecessors;
struct tsort_ **ppPredecessors;
struct tsort_ *pNext;
} TSort;
static TSort *prepare(pool *p,TSortData *pItems,int nItems)
{
TSort *pData=ap_palloc(p,nItems*sizeof *pData);
int n;
for(n=0 ; n < nItems ; ++n)
{
pData[n].nPredecessors=0;
pData[n].ppPredecessors=ap_palloc(p,nItems*sizeof *pData[n].ppPredecessors);
pData[n].pNext=NULL;
pData[n].pData=&pItems[n];
}
for(n=0 ; n < nItems ; ++n)
{
int i,k;
for(i=0 ; pItems[n].aszPredecessors && pItems[n].aszPredecessors[i] ; ++i)
for(k=0 ; k < nItems ; ++k)
if(!strcmp(pItems[k].szName,pItems[n].aszPredecessors[i]))
{
int l;
for(l=0 ; l < pData[n].nPredecessors ; ++l)
if(pData[n].ppPredecessors[l] == &pData[k])
goto got_it;
pData[n].ppPredecessors[pData[n].nPredecessors]=&pData[k];
++pData[n].nPredecessors;
got_it:
break;
}
for(i=0 ; pItems[n].aszSuccessors && pItems[n].aszSuccessors[i] ; ++i)
for(k=0 ; k < nItems ; ++k)
if(!strcmp(pItems[k].szName,pItems[n].aszSuccessors[i]))
{
int l;
for(l=0 ; l < pData[k].nPredecessors ; ++l)
if(pData[k].ppPredecessors[l] == &pData[n])
goto got_it2;
pData[k].ppPredecessors[pData[k].nPredecessors]=&pData[n];
++pData[k].nPredecessors;
got_it2:
break;
}
}
return pData;
}
static TSort *tsort(TSort *pData,int nItems)
{
int nTotal;
TSort *pHead=NULL;
TSort *pTail=NULL;
for(nTotal=0 ; nTotal < nItems ; ++nTotal)
{
int n,i,k;
for(n=0 ; ; ++n)
{
if(n == nItems)
assert(0); // we have a loop...
if(!pData[n].pNext && !pData[n].nPredecessors)
break;
}
if(pTail)
pTail->pNext=&pData[n];
else
pHead=&pData[n];
pTail=&pData[n];
pTail->pNext=pTail; // fudge it so it looks linked
for(i=0 ; i < nItems ; ++i)
for(k=0 ; pData[i].ppPredecessors[k] ; ++k)
if(pData[i].ppPredecessors[k] == &pData[n])
{
--pData[i].nPredecessors;
break;
}
}
pTail->pNext=NULL; // unfudge the tail
return pHead;
}
static array_header *sort_hook(array_header *pHooks,const char *szName)
{
pool *p=ap_make_sub_pool(g_pHookPool);
TSort *pSort;
array_header *pNew;
int n;
pSort=prepare(p,(TSortData *)pHooks->elts,pHooks->nelts);
tsort(pSort,pHooks->nelts);
pNew=ap_make_array(g_pHookPool,pHooks->nelts,sizeof(TSortData));
if(g_bDebugHooks)
printf("Sorting %s:",szName);
for(n=0 ; pSort ; pSort=pSort->pNext,++n)
{
TSortData *pHook;
assert(n < pHooks->nelts);
pHook=ap_push_array(pNew);
memcpy(pHook,pSort->pData,sizeof *pHook);
if(g_bDebugHooks)
printf(" %s",pHook->szName);
}
if(g_bDebugHooks)
fputc('\n',stdout);
return pNew;
}
static array_header *s_aHooksToSort;
typedef struct
{
const char *szHookName;
array_header **paHooks;
} HookSortEntry;
void ap_hook_sort_register(const char *szHookName,array_header **paHooks)
{
HookSortEntry *pEntry;
if(!s_aHooksToSort)
s_aHooksToSort=ap_make_array(g_pHookPool,1,sizeof(HookSortEntry));
pEntry=ap_push_array(s_aHooksToSort);
pEntry->szHookName=szHookName;
pEntry->paHooks=paHooks;
}
void ap_sort_hooks()
{
int n;
for(n=0 ; n < s_aHooksToSort->nelts ; ++n)
{
HookSortEntry *pEntry=&((HookSortEntry *)s_aHooksToSort->elts)[n];
*pEntry->paHooks=sort_hook(*pEntry->paHooks,pEntry->szHookName);
}
}
void ap_show_hook(const char *szName,const char * const *aszPre,
const char * const *aszSucc)
{
int nFirst;
printf(" Hooked %s",szName);
if(aszPre)
{
fputs(" pre(",stdout);
nFirst=1;
while(*aszPre)
{
if(!nFirst)
fputc(',',stdout);
nFirst=0;
fputs(*aszPre,stdout);
++aszPre;
}
fputc(')',stdout);
}
if(aszSucc)
{
fputs(" succ(",stdout);
nFirst=1;
while(*aszSucc)
{
if(!nFirst)
fputc(',',stdout);
nFirst=0;
fputs(*aszSucc,stdout);
++aszSucc;
}
fputc(')',stdout);
}
fputc('\n',stdout);
}
#if 0
void main()
{
const char *aszAPre[]={"b","c",NULL};
const char *aszBPost[]={"a",NULL};
const char *aszCPost[]={"b",NULL};
TSortData t1[]=
{
{ "a",aszAPre,NULL },
{ "b",NULL,aszBPost },
{ "c",NULL,aszCPost }
};
TSort *pResult;
pResult=prepare(t1,3);
pResult=tsort(pResult,3);
for( ; pResult ; pResult=pResult->pNext)
printf("%s\n",pResult->pData->szName);
}
#endif
1.5 +19 -5 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ap_hooks.h 1999/07/10 18:58:17 1.4
+++ ap_hooks.h 1999/07/11 13:27:24 1.5
@@ -1,15 +1,16 @@
#ifndef APACHE_AP_HOOKS_H
#define APACHE_AP_HOOKS_H
-extern int g_bDebugHooks;
-
#define DECLARE_HOOK(ret,name,args) \
typedef ret HOOK_##name args; \
-void ap_hook_##name(HOOK_##name *pf); \
+void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre,const char * const *aszSucc); \
ret ap_run_##name args; \
typedef struct _LINK_##name \
{ \
HOOK_##name *pFunc; \
+ const char *szName; \
+ const char * const *aszPredecessors; \
+ const char * const *aszSuccessors; \
} LINK_##name;
#define HOOK_STRUCT(members) \
@@ -19,15 +20,21 @@
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) \
+void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre,const char * const *aszSucc) \
{ \
LINK_##name *pHook; \
if(!_hooks.link_##name) \
+ { \
_hooks.link_##name=ap_make_array(g_pHookPool,1,sizeof(LINK_##name)); \
+ ap_hook_sort_register(#name,&_hooks.link_##name); \
+ } \
pHook=ap_push_array(_hooks.link_##name); \
pHook->pFunc=pf; \
+ pHook->aszPredecessors=aszPre; \
+ pHook->aszSuccessors=aszSucc; \
+ pHook->szName=g_szCurrentHookName; \
if(g_bDebugHooks) \
- puts(" Hooked " #name); \
+ ap_show_hook(#name,aszPre,aszSucc); \
} \
ret ap_run_##name args \
{ \
@@ -55,5 +62,12 @@
IMPLEMENT_HOOK_BASE(void,,,,name,args,args2,run_all,1,0,)
extern pool *g_pHookPool;
+extern int g_bDebugHooks;
+extern const char *g_szCurrentHookName;
+
+void ap_hook_sort_register(const char *szHookName,array_header **aHooks);
+void ap_sort_hooks(void);
+void ap_show_hook(const char *szName,const char * const *aszPre,
+ const char * const *aszSucc);
#endif /* ndef(AP_HOOKS_H) */
1.6 +0 -1 apache-2.0/mpm/src/include/http_config.h
Index: http_config.h
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_config.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- http_config.h 1999/07/06 21:32:08 1.5
+++ http_config.h 1999/07/11 13:27:24 1.6
@@ -240,7 +240,6 @@
* logger --- log a transaction.
*/
- int (*translate_handler) (request_rec *);
int (*ap_check_user_id) (request_rec *);
int (*auth_checker) (request_rec *);
int (*access_checker) (request_rec *);
1.2 +5 -0 apache-2.0/mpm/src/include/http_request.h
Index: http_request.h
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/include/http_request.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- http_request.h 1999/06/18 18:39:28 1.1
+++ http_request.h 1999/07/11 13:27:24 1.2
@@ -58,6 +58,8 @@
#ifndef APACHE_HTTP_REQUEST_H
#define APACHE_HTTP_REQUEST_H
+#include "ap_hooks.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -109,6 +111,9 @@
void ap_process_request(request_rec *);
API_EXPORT(void) ap_die(int type, request_rec *r);
#endif
+
+ /* Hooks */
+DECLARE_HOOK(int,translate_name,(request_rec *))
#ifdef __cplusplus
}
1.8 +4 -8 apache-2.0/mpm/src/main/http_config.c
Index: http_config.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_config.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- http_config.c 1999/07/10 13:32:47 1.7
+++ http_config.c 1999/07/11 13:27:25 1.8
@@ -237,7 +237,6 @@
{
#define m(meth) { XtOffsetOf(module,meth),#meth }
- m(translate_handler),
m(ap_check_user_id),
m(auth_checker),
m(type_checker),
@@ -277,7 +276,6 @@
*/
static const int method_offsets[] =
{
- XtOffsetOf(module, translate_handler),
XtOffsetOf(module, ap_check_user_id),
XtOffsetOf(module, auth_checker),
XtOffsetOf(module, access_checker),
@@ -288,7 +286,6 @@
#define NMETHODS (sizeof (method_offsets)/sizeof (method_offsets[0]))
static struct {
- int translate_handler;
int ap_check_user_id;
int auth_checker;
int access_checker;
@@ -372,11 +369,6 @@
return run_all ? OK : DECLINED;
}
-int ap_translate_name(request_rec *r)
-{
- return run_method(r, offsets_into_method_ptrs.translate_handler, 0);
-}
-
int ap_check_access(request_rec *r)
{
return run_method(r, offsets_into_method_ptrs.access_checker, 1);
@@ -530,6 +522,7 @@
}
int g_bDebugHooks;
+const char *g_szCurrentHookName;
static void register_hooks(module *m)
{
@@ -540,6 +533,7 @@
printf("Registering hooks for %s\n",m->name);
g_bDebugHooks=1;
}
+ g_szCurrentHookName=m->name;
m->register_hooks();
}
}
@@ -723,6 +717,8 @@
*/
for (m = ap_prelinked_modules; *m != NULL; m++)
ap_add_module(*m);
+
+ ap_sort_hooks();
}
API_EXPORT(const char *) ap_find_module_name(module *m)
1.4 +6 -2 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- http_core.c 1999/07/06 21:32:10 1.3
+++ http_core.c 1999/07/11 13:27:25 1.4
@@ -2629,6 +2629,11 @@
ap_open_logs(s, pconf);
}
+static void register_hooks()
+ {
+ ap_hook_translate_name(core_translate,NULL,NULL);
+ }
+
API_VAR_EXPORT module core_module = {
STANDARD20_MODULE_STUFF,
NULL, /* pre_command_line */
@@ -2642,12 +2647,11 @@
merge_core_server_configs, /* merge per-server config structures */
core_cmds, /* command table */
core_handlers, /* handlers */
- core_translate, /* translate_handler */
NULL, /* check_user_id */
NULL, /* check auth */
do_nothing, /* check access */
do_nothing, /* type_checker */
NULL, /* pre-run fixups */
NULL, /* logger */
- NULL /* register hooks */
+ register_hooks /* register hooks */
};
1.8 +8 -2 apache-2.0/mpm/src/main/http_request.c
Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/main/http_request.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- http_request.c 1999/07/07 15:31:59 1.7
+++ http_request.c 1999/07/11 13:27:25 1.8
@@ -78,6 +78,12 @@
#endif
#include "fnmatch.h"
+HOOK_STRUCT(
+ HOOK_LINK(translate_name)
+)
+
+IMPLEMENT_HOOK(int,translate_name,(request_rec *r),(r),0,OK,DECLINED)
+
/*****************************************************************
*
* Getting and checking directory configuration. Also checks the
@@ -772,7 +778,7 @@
return rnew;
}
- res = ap_translate_name(rnew);
+ res = ap_run_translate_name(rnew);
if (res) {
rnew->status = res;
return rnew;
@@ -1114,7 +1120,7 @@
return;
}
- if ((access_status = ap_translate_name(r))) {
+ if ((access_status = ap_run_translate_name(r))) {
decl_die(access_status, "translate", r);
return;
}
1.9 +0 -1 apache-2.0/mpm/src/modules/mpm/prefork/prefork.c
Index: prefork.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/mpm/prefork/prefork.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- prefork.c 1999/07/06 21:32:15 1.8
+++ prefork.c 1999/07/11 13:27:27 1.9
@@ -3086,7 +3086,6 @@
NULL, /* merge per-server config structures */
prefork_cmds, /* command table */
NULL, /* handlers */
- NULL, /* translate_handler */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_access.c
Index: mod_access.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_access.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_access.c 1999/07/06 21:32:18 1.3
+++ mod_access.c 1999/07/11 13:27:27 1.4
@@ -400,7 +400,6 @@
NULL, /* merge server config */
access_cmds,
NULL, /* handlers */
- NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
check_dir_access, /* check access */
1.4 +9 -2 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_alias.c 1999/07/06 21:32:19 1.3
+++ mod_alias.c 1999/07/11 13:27:28 1.4
@@ -65,6 +65,7 @@
#include "httpd.h"
#include "http_config.h"
+#include "http_request.h"
typedef struct {
char *real;
@@ -394,6 +395,13 @@
return DECLINED;
}
+static void register_hooks()
+ {
+ static const char * const aszPre[]={ "mod_userdir.c",NULL };
+
+ ap_hook_translate_name(translate_alias_redir,aszPre,NULL);
+ }
+
module MODULE_VAR_EXPORT alias_module =
{
STANDARD20_MODULE_STUFF,
@@ -408,12 +416,11 @@
merge_alias_config, /* merge server configs */
alias_cmds, /* command table */
NULL, /* handlers */
- translate_alias_redir, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
NULL, /* type_checker */
fixup_redir, /* fixups */
NULL, /* logger */
- NULL /* register hooks */
+ register_hooks /* register hooks */
};
1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_asis.c
Index: mod_asis.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_asis.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_asis.c 1999/07/06 21:32:19 1.3
+++ mod_asis.c 1999/07/11 13:27:28 1.4
@@ -137,7 +137,6 @@
NULL, /* merge per-server config structures */
NULL, /* command table */
asis_handlers, /* handlers */
- NULL, /* translate_handler */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_auth.c
Index: mod_auth.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_auth.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_auth.c 1999/07/06 21:32:19 1.3
+++ mod_auth.c 1999/07/11 13:27:28 1.4
@@ -323,7 +323,6 @@
NULL, /* merge server config */
auth_cmds, /* command table */
NULL, /* handlers */
- NULL, /* filename translation */
authenticate_basic_user, /* check_user_id */
check_user_access, /* check auth */
NULL, /* check access */
1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_autoindex.c
Index: mod_autoindex.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_autoindex.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_autoindex.c 1999/07/06 21:32:20 1.3
+++ mod_autoindex.c 1999/07/11 13:27:28 1.4
@@ -1661,7 +1661,6 @@
NULL, /* merge server config */
autoindex_cmds, /* command table */
autoindex_handlers, /* handlers */
- NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.3 +0 -1 apache-2.0/mpm/src/modules/standard/mod_dir.c
Index: mod_dir.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_dir.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mod_dir.c 1999/07/06 21:32:20 1.2
+++ mod_dir.c 1999/07/11 13:27:28 1.3
@@ -235,7 +235,6 @@
NULL, /* merge per-server config structures */
dir_cmds, /* command table */
dir_handlers, /* handlers */
- NULL, /* translate_handler */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.5 +0 -1 apache-2.0/mpm/src/modules/standard/mod_env.c
Index: mod_env.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_env.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- mod_env.c 1999/07/06 21:32:21 1.4
+++ mod_env.c 1999/07/11 13:27:28 1.5
@@ -260,7 +260,6 @@
NULL, /* merge server configs */
env_module_cmds, /* command table */
NULL, /* handlers */
- NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_imap.c
Index: mod_imap.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_imap.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_imap.c 1999/07/06 21:32:21 1.3
+++ mod_imap.c 1999/07/11 13:27:28 1.4
@@ -908,7 +908,6 @@
NULL, /* merge server config */
imap_cmds, /* command table */
imap_handlers, /* handlers */
- NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_log_config.c
Index: mod_log_config.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_log_config.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_log_config.c 1999/07/06 21:32:22 1.3
+++ mod_log_config.c 1999/07/11 13:27:29 1.4
@@ -1118,7 +1118,6 @@
merge_config_log_state, /* merge server config */
config_log_cmds, /* command table */
NULL, /* handlers */
- NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.3 +0 -1 apache-2.0/mpm/src/modules/standard/mod_mime.c
Index: mod_mime.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_mime.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mod_mime.c 1999/07/06 21:32:22 1.2
+++ mod_mime.c 1999/07/11 13:27:29 1.3
@@ -391,7 +391,6 @@
NULL, /* merge per-server config structures */
mime_cmds, /* command table */
NULL, /* handlers */
- NULL, /* translate_handler */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.4 +0 -1 apache-2.0/mpm/src/modules/standard/mod_negotiation.c
Index: mod_negotiation.c
===================================================================
RCS file: /export/home/cvs/apache-2.0/mpm/src/modules/standard/mod_negotiation.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_negotiation.c 1999/07/06 21:32:22 1.3
+++ mod_negotiation.c 1999/07/11 13:27:29 1.4
@@ -2738,7 +2738,6 @@
NULL, /* merge server config */
negotiation_cmds, /* command table */
negotiation_handlers, /* handlers */
- NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.4 +1 -2 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_setenvif.c 1999/07/06 21:32:23 1.3
+++ mod_setenvif.c 1999/07/11 13:27:29 1.4
@@ -402,7 +402,7 @@
static void register_hooks()
{
- ap_hook_post_read_request(match_headers);
+ ap_hook_post_read_request(match_headers,NULL,NULL);
}
module MODULE_VAR_EXPORT setenvif_module =
@@ -419,7 +419,6 @@
merge_setenvif_config, /* merge server configs */
setenvif_module_cmds, /* command table */
NULL, /* handlers */
- NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
1.4 +9 -2 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_userdir.c 1999/07/06 21:32:23 1.3
+++ mod_userdir.c 1999/07/11 13:27:29 1.4
@@ -92,6 +92,7 @@
#include "httpd.h"
#include "http_config.h"
+#include "http_request.h"
module userdir_module;
@@ -326,6 +327,13 @@
return DECLINED;
}
+static void register_hooks()
+ {
+ static const char * const aszSucc[]={ "mod_alias.c",NULL };
+
+ ap_hook_translate_name(translate_userdir,NULL,aszSucc);
+ }
+
module userdir_module = {
STANDARD20_MODULE_STUFF,
NULL, /* pre_command_line */
@@ -339,12 +347,11 @@
NULL, /* merge server config */
userdir_cmds, /* command table */
NULL, /* handlers */
- translate_userdir, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
NULL, /* type_checker */
NULL, /* fixups */
NULL, /* logger */
- NULL /* register hooks */
+ register_hooks /* register hooks */
};
Re: cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c
mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c
mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c
mod_userdir.c
Posted by Ben Laurie <be...@algroup.co.uk>.
Rasmus Lerdorf wrote:
>
> > Log:
> > Add topological sorting to hook ordering.
>
> 'scuse my cranial density here, but what does this actually mean? It
> sounds cool.
It means that each hook can specify two lists of other modules, those it
wants to come after, and those it wants to come before. A topological
sort is the type of sort that orders the hooks given these constraints.
I intend to also add a cruder "put me at the front/back" style of
ordering, for things like http_core, which want to do name_translate
last of all (err, I think), no matter what, and the like. This will be
done before the topological sort (since the topological sort is stable,
and will therefore preserve as much as it can of this ordering).
My intention is to completely avoid any requirement for "magic" ordering
of modules. It also makes it possible for one module to be called first
for one hook and last for another, which is currently impossible.
See the name_translate hook in mod_alias and mod_userdir for an example
(they redundantly specify each other, but that's allowed).
BTW, I'm pretty sure not all such dependencies are documented (or even
necessarily known) so it would be good if people would keep it in the
backs of their minds when they happen to be thinking about such things.
Double-BTW: specify -DSHOW_HOOKS to see this stuff going on...
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi
Re: cvs commit: apache-2.0/mpm/src/modules/standard mod_access.c
mod_alias.c mod_asis.c mod_auth.c mod_autoindex.c mod_dir.c mod_env.c
mod_imap.c mod_log_config.c mod_mime.c mod_negotiation.c mod_setenvif.c
mod_userdir.c
Posted by Rasmus Lerdorf <ra...@lerdorf.on.ca>.
> Log:
> Add topological sorting to hook ordering.
'scuse my cranial density here, but what does this actually mean? It
sounds cool.
-Rasmus