[svn:mod_parrot] r422 - mod_parrot/branches/hll-modules/src
[email protected] Thu, 18 Sep 2008 12:03:40 -0700 (PDT)
| Newsgroups | perl.cvs.mod_parrot |
|---|---|
| Message-ID | <[email protected]> |
Author: jhorwitz
Date: Thu Sep 18 12:03:39 2008
New Revision: 422
Modified:
mod_parrot/branches/hll-modules/src/mod_parrot.c
Log:
refactor request lifecycle handlers
Modified: mod_parrot/branches/hll-modules/src/mod_parrot.c
==============================================================================
--- mod_parrot/branches/hll-modules/src/mod_parrot.c (original)
+++ mod_parrot/branches/hll-modules/src/mod_parrot.c Thu Sep 18 12:03:39 2008
@@ -42,6 +42,17 @@
#define SHOULD_HANDLE(x) (x->handler ? \
(strncmp(x->handler, MODPARROT_MAGIC, strlen(MODPARROT_MAGIC)) ? 0 : 1) : 0)
+#define SET_HLL_HANDLER(x) \
+ if (!dircfg->x) return DECLINED; \
+ hll = NULL; \
+ hll = dircfg->x->hll ? dircfg->x->hll : dircfg->hll; \
+ if (!hll) { \
+ if (!(hll = (get_request_hll(r, r->handler, r->content_type)))) { \
+ hll = MODPARROT_DEFAULT_HLL; \
+ } \
+ } \
+ hll_handler = dircfg->x ? dircfg->x->id : (char *)r->handler;
+
/* declare our module */
extern module AP_MODULE_DECLARE_DATA parrot_module;
@@ -268,33 +279,18 @@
return NULL;
}
-/* This macro checks whether we should handle a particular phase, and if so,
- * sets the HLL and handler name accordingly.
- */
-#define SET_HLL_HANDLER(x) \
- if (!dircfg->x) return DECLINED; \
- hll = NULL; \
- hll = dircfg->x->hll ? dircfg->x->hll : dircfg->hll; \
- if (!hll) { \
- if (!(hll = (get_request_hll(r, r->handler, r->content_type)))) { \
- hll = MODPARROT_DEFAULT_HLL; \
- } \
- } \
- hll_handler = dircfg->x ? dircfg->x->id : (char *)r->handler;
-
-static int modparrot_handler(request_rec *r)
+static int modparrot_request_phase_handler(request_rec *r)
{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
+ /* XXX WHERE TO PUT THIS???? */
+#if 0
/* take this opportunity to register the mod_parrot cleanup handler here,
* as we may not handle any other part of the request until then.
*/
apr_pool_cleanup_register(r->pool, r, modparrot_request_cleanup,
apr_pool_cleanup_null);
+#endif
/* initialize context */
if (!(ctxp = init_ctx(r->server))) {
@@ -312,74 +308,9 @@
return DECLINED;
}
-int modparrot_meta_response_handler(request_rec *r)
-{
- modparrot_context *ctxp;
- modparrot_module_config *dircfg;
- modparrot_srv_config *mpcfg;
- module *modp;
- modparrot_module_info *minfo;
- Parrot_PMC sub;
- int status;
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* get next module in line */
- ctxp->module_index++;
-
- /* decline if mod_parrot isn't enabled */
- mpcfg = ap_get_module_config(r->server->module_config, &parrot_module);
- if (!(mpcfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- ctxp->r = r;
-
- /* XXX register cleanup handler here or in the meta handler? */
-
- /* XXX does this belong in the meta handler? */
- if (r->header_only) {
- return OK;
- }
-
- /* get HLL config */
- modp = ((module **)mpcfg->module_array->elts)[ctxp->module_index];
- minfo = (modparrot_module_info *)modp->dynamic_load_handle;
- dircfg = (modparrot_module_config *)ap_get_module_config(r->per_dir_config,
- modp);
- /* call meta handler */
- if (!modparrot_call_meta_handler(ctxp->interp, minfo->namespace, "handler",
- &status)) {
- MPLOG_ERRORF(r->server,
- "no response metahandler found for module '%s'", modp->name);
- status = HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return status;
-}
-
static int modparrot_pre_connection_handler(conn_rec *c, void *csd)
{
- modparrot_srv_config *cfg;
modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll;
-
- /* get apache configs */
- cfg = ap_get_module_config(c->base_server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- /* politely decline request if not our handler */
- if (!(cfg->option_flags & MP_OPT_ENABLE) || !cfg->pre_connection_handler) {
- return DECLINED;
- }
/* initialize context */
if (!(ctxp = init_ctx(c->base_server))) {
@@ -387,156 +318,115 @@
return HTTP_INTERNAL_SERVER_ERROR;
}
- ctxp->c = c;
- ctxp->csd = csd;
-
- /* call HLL handler */
- sub = "pre_connection_handler";
- hll = cfg->pre_connection_handler->hll ?
- cfg->pre_connection_handler->hll : MODPARROT_DEFAULT_HLL;
-
- if (!modparrot_meta_handler(ctxp->interp, hll, sub,
- cfg->pre_connection_handler->id, &handler_status)) {
- MPLOG_ERRORF(c->base_server, "no subroutine found for handler '%s'",
- cfg->pre_connection_handler->id);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
+ /* we're REALLY_FIRST, so reset the module index */
+ ctxp->module_index = -1;
/* clean up */
release_ctx(ctxp);
- /* tell apache we're done */
- return handler_status;
+ /* we only do setup */
+ return DECLINED;
}
-static int modparrot_map_to_storage_handler(request_rec *r)
+#define MP_REQUEST_METAHANDLER(hname) \
+ int modparrot_meta_##hname(request_rec *r) \
+ { \
+ modparrot_context *ctxp; \
+ modparrot_module_config *dircfg; \
+ modparrot_srv_config *mpcfg; \
+ module *modp; \
+ modparrot_module_info *minfo; \
+ Parrot_PMC sub; \
+ int status; \
+ /* initialize context */ \
+ if (!(ctxp = init_ctx(r->server))) { \
+ MPLOG_ERROR(r->server, "context initialization failed"); \
+ return HTTP_INTERNAL_SERVER_ERROR; \
+ } \
+ /* get next module in line */ \
+ ctxp->module_index++; \
+ /* decline if mod_parrot isn't enabled */ \
+ mpcfg = ap_get_module_config(r->server->module_config, \
+ &parrot_module); \
+ if (!(mpcfg->option_flags & MP_OPT_ENABLE)) return DECLINED; \
+ ctxp->r = r; \
+ /* XXX register cleanup handler here or in the meta handler? */ \
+ /* XXX does header_only check belong in the meta handler? */ \
+ if (r->header_only) { \
+ return OK; \
+ } \
+ /* get HLL config */ \
+ modp = ((module **)mpcfg->module_array->elts)[ctxp->module_index]; \
+ minfo = (modparrot_module_info *)modp->dynamic_load_handle; \
+ dircfg = (modparrot_module_config *)ap_get_module_config( \
+ r->per_dir_config, modp); \
+ /* call meta handler */ \
+ if (!modparrot_call_meta_handler(ctxp->interp, minfo->namespace, \
+ #hname , &status)) { \
+ MPLOG_ERRORF(r->server, \
+ #hname " not found in module '%s'", \
+ modp->name); \
+ status = HTTP_INTERNAL_SERVER_ERROR; \
+ } \
+ /* clean up */ \
+ release_ctx(ctxp); \
+ /* tell apache we're done */ \
+ return status; \
+ }
+
+MP_REQUEST_METAHANDLER(map_to_storage_handler)
+MP_REQUEST_METAHANDLER(translate_name_handler)
+MP_REQUEST_METAHANDLER(post_read_request_handler)
+MP_REQUEST_METAHANDLER(header_parser_handler)
+MP_REQUEST_METAHANDLER(access_handler)
+MP_REQUEST_METAHANDLER(authen_handler)
+MP_REQUEST_METAHANDLER(authz_handler)
+MP_REQUEST_METAHANDLER(response_handler)
+MP_REQUEST_METAHANDLER(type_checker_handler)
+MP_REQUEST_METAHANDLER(fixup_handler)
+MP_REQUEST_METAHANDLER(log_handler)
+
+static int modparrot_meta_pre_connection_handler(conn_rec *c, void *csd)
{
- modparrot_srv_config *cfg;
modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll;
-
- /* get apache configs */
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- /* politely decline request if not our handler */
- if (!(cfg->option_flags & MP_OPT_ENABLE) || !cfg->map_to_storage_handler) {
- return DECLINED;
- }
+ modparrot_srv_config *mpcfg;
+ module *modp;
+ modparrot_module_info *minfo;
+ Parrot_PMC sub;
+ int status;
/* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "map_to_storage_handler";
- hll = cfg->map_to_storage_handler->hll ?
- cfg->map_to_storage_handler->hll : MODPARROT_DEFAULT_HLL;
-
- if (!modparrot_meta_handler(ctxp->interp, hll, sub,
- cfg->map_to_storage_handler->id, &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- cfg->map_to_storage_handler->id);
- release_ctx(ctxp);
+ if (!(ctxp = init_ctx(c->base_server))) {
+ MPLOG_ERROR(c->base_server, "context initialization failed");
return HTTP_INTERNAL_SERVER_ERROR;
}
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_header_parser_handler(request_rec *r)
-{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
-
- /* get apache configs */
- dircfg = (modparrot_dir_config *)ap_get_module_config(r->per_dir_config, &parrot_module);
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- SET_HLL_HANDLER(header_parser_handler);
+ /* get next module in line */
+ ctxp->module_index++;
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
+ /* decline if mod_parrot isn't enabled */
+ mpcfg = ap_get_module_config(c->base_server->module_config, &parrot_module);
+ if (!(mpcfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
- ctxp->r = r;
+ ctxp->c = c;
+ ctxp->csd = csd;
- /* call HLL handler */
- sub = "header_parser_handler";
- if (!modparrot_meta_handler(ctxp->interp, hll, sub, hll_handler,
- &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- hll_handler);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
+ /* get HLL config */
+ modp = ((module **)mpcfg->module_array->elts)[ctxp->module_index];
+ minfo = (modparrot_module_info *)modp->dynamic_load_handle;
+ /* call meta handler */
+ if (!modparrot_call_meta_handler(ctxp->interp, minfo->namespace,
+ "pre_connection_handler", &status)) {
+ MPLOG_ERRORF(c->base_server,
+ "no pre_connection metahandler found for module '%s'", modp->name);
+ status = HTTP_INTERNAL_SERVER_ERROR;
}
/* clean up */
release_ctx(ctxp);
/* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_post_read_request_handler(request_rec *r)
-{
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll;
-
- /* get apache configs */
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- /* politely decline request if not our handler */
- if (!(cfg->option_flags & MP_OPT_ENABLE) ||
- !cfg->post_read_request_handler) {
- return DECLINED;
- }
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "post_read_request_handler";
- hll = cfg->post_read_request_handler->hll ?
- cfg->post_read_request_handler->hll : MODPARROT_DEFAULT_HLL;
-
- if (!modparrot_meta_handler(ctxp->interp, hll, sub,
- cfg->post_read_request_handler->id, &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- cfg->post_read_request_handler->id);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* tell apache we're done */
- return handler_status;
+ return status;
}
static int modparrot_process_connection_handler(conn_rec *c)
@@ -627,303 +517,6 @@
return;
}
-static int modparrot_trans_handler(request_rec *r)
-{
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll;
-
- /* get apache configs */
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- /* politely decline request if not our handler */
- if (!(cfg->option_flags & MP_OPT_ENABLE) || !cfg->trans_handler) {
- return DECLINED;
- }
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "trans_handler";
- hll = cfg->trans_handler->hll ?
- cfg->trans_handler->hll : MODPARROT_DEFAULT_HLL;
-
- if (!modparrot_meta_handler(ctxp->interp, hll, sub,
- cfg->trans_handler->id, &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- cfg->trans_handler->id);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_fixup_handler(request_rec *r)
-{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
-
- /* get apache configs */
- dircfg = (modparrot_dir_config *)ap_get_module_config(r->per_dir_config, &parrot_module);
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- SET_HLL_HANDLER(fixup_handler);
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "fixup_handler";
- if (!modparrot_meta_handler(ctxp->interp, hll, sub, hll_handler,
- &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- hll_handler);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_type_handler(request_rec *r)
-{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
-
- /* get apache configs */
- dircfg = (modparrot_dir_config *)ap_get_module_config(r->per_dir_config, &parrot_module);
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- SET_HLL_HANDLER(type_handler);
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "type_handler";
- if (!modparrot_meta_handler(ctxp->interp, hll, sub, hll_handler,
- &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- hll_handler);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_log_handler(request_rec *r)
-{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
-
- /* politely decline request if we shouldn't be handling this */
- if (!SHOULD_HANDLE(r)) {
- return DECLINED;
- }
-
- /* get apache configs */
- dircfg = (modparrot_dir_config *)ap_get_module_config(r->per_dir_config, &parrot_module);
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- SET_HLL_HANDLER(log_handler);
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERROR(r->server, "context initialization failed");
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "log_handler";
- if (!modparrot_meta_handler(ctxp->interp, hll, sub, hll_handler,
- &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- hll_handler);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_access_handler(request_rec *r)
-{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
-
- /* get apache configs */
- dircfg = (modparrot_dir_config *)ap_get_module_config(r->per_dir_config, &parrot_module);
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- SET_HLL_HANDLER(access_handler);
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERRORF(r->server,
- "context initialization failed for access handler '%s'",
- dircfg->access_handler->id);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "access_handler";
- if (!modparrot_meta_handler(ctxp->interp, hll, sub, hll_handler,
- &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- hll_handler);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_authen_handler(request_rec *r)
-{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
-
- /* get apache configs */
- dircfg = (modparrot_dir_config *)ap_get_module_config(r->per_dir_config, &parrot_module);
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- SET_HLL_HANDLER(authen_handler);
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERRORF(r->server,
- "context initialization failed for authen handler '%s'",
- dircfg->authen_handler->id);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "authen_handler";
- if (!modparrot_meta_handler(ctxp->interp, hll, sub, hll_handler,
- &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- hll_handler);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
-static int modparrot_authz_handler(request_rec *r)
-{
- modparrot_dir_config *dircfg;
- modparrot_srv_config *cfg;
- modparrot_context *ctxp;
- int handler_status;
- char *sub, *hll, *hll_handler;
-
- /* get apache configs */
- dircfg = (modparrot_dir_config *)ap_get_module_config(r->per_dir_config, &parrot_module);
- cfg = ap_get_module_config(r->server->module_config, &parrot_module);
-
- if (!(cfg->option_flags & MP_OPT_ENABLE)) return DECLINED;
-
- SET_HLL_HANDLER(authz_handler);
-
- /* initialize context */
- if (!(ctxp = init_ctx(r->server))) {
- MPLOG_ERRORF(r->server,
- "context initialization failed for authz handler '%s'",
- dircfg->authz_handler->id);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
- ctxp->r = r;
-
- /* call HLL handler */
- sub = "authz_handler";
- if (!modparrot_meta_handler(ctxp->interp, hll, sub, hll_handler,
- &handler_status)) {
- MPLOG_ERRORF(r->server, "no subroutine found for handler '%s'",
- hll_handler);
- release_ctx(ctxp);
- return HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* clean up */
- release_ctx(ctxp);
-
- /* tell apache we're done */
- return handler_status;
-}
-
static int modparrot_post_config_handler(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)
{
@@ -1118,23 +711,41 @@
*(char **)apr_array_push(ap_server_config_defines) =
(char *)apr_pstrdup(p, "MODPARROT");
- /* register the various hooks */
- ap_hook_post_config(modparrot_post_config_handler, NULL, NULL, APR_HOOK_FIRST);
- ap_hook_child_init(modparrot_child_init_handler, NULL, NULL, APR_HOOK_FIRST);
- ap_hook_pre_connection(modparrot_pre_connection_handler, NULL, NULL, APR_HOOK_FIRST);
- ap_hook_process_connection(modparrot_process_connection_handler, NULL, NULL, APR_HOOK_FIRST);
- ap_hook_map_to_storage(modparrot_map_to_storage_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_translate_name(modparrot_trans_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_post_read_request(modparrot_post_read_request_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_header_parser(modparrot_header_parser_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_handler(modparrot_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_type_checker(modparrot_type_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_fixups(modparrot_fixup_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_log_transaction(modparrot_log_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
+ /* register the various hooks. all request phase hooks are handled by
+ * modparrot_request_phase_handler, as the calling conventions and
+ * and semantics of each hook in this phase are identical.
+ */
ap_hook_open_logs(modparrot_open_logs_handler, NULL, NULL, APR_HOOK_FIRST);
- ap_hook_access_checker(modparrot_access_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_check_user_id(modparrot_authen_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
- ap_hook_auth_checker(modparrot_authz_handler, NULL, NULL, APR_HOOK_REALLY_FIRST);
+ ap_hook_post_config(modparrot_post_config_handler, NULL, NULL,
+ APR_HOOK_FIRST);
+ ap_hook_child_init(modparrot_child_init_handler, NULL, NULL,
+ APR_HOOK_FIRST);
+ ap_hook_pre_connection(modparrot_pre_connection_handler, NULL, NULL,
+ APR_HOOK_FIRST);
+ ap_hook_process_connection(modparrot_process_connection_handler, NULL,
+ NULL, APR_HOOK_FIRST);
+ ap_hook_map_to_storage(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_translate_name(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_post_read_request(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_header_parser(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_access_checker(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_check_user_id(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_auth_checker(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_handler(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_type_checker(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_fixups(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
+ ap_hook_log_transaction(modparrot_request_phase_handler, NULL, NULL,
+ APR_HOOK_REALLY_FIRST);
}
static const command_rec modparrot_cmds[] =