Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 35467 invoked by uid 500); 15 May 2001 04:25:20 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 35452 invoked by uid 500); 15 May 2001 04:25:18 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 15 May 2001 04:25:17 -0000 Message-ID: <20010515042517.35448.qmail@apache.org> From: dougm@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0 CHANGES dougm 01/05/14 21:25:17 Modified: modules/generators mod_info.c . CHANGES Log: add "Request Phase Participation" info to mod_info Submitted by: dougm Reviewed by: gstein Revision Changes Path 1.36 +90 -1 httpd-2.0/modules/generators/mod_info.c Index: mod_info.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_info.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- mod_info.c 2001/04/13 19:00:36 1.35 +++ mod_info.c 2001/05/15 04:25:15 1.36 @@ -92,6 +92,7 @@ #include "http_log.h" #include "http_main.h" #include "http_protocol.h" +#include "http_request.h" #include "util_script.h" #include "apr_strings.h" #include "apr_lib.h" @@ -247,6 +248,86 @@ } } + +typedef struct { /*XXX: should get something from apr_hooks.h instead */ + void (*pFunc)(void); /* just to get the right size */ + const char *szName; + const char * const *aszPredecessors; + const char * const *aszSuccessors; + int nOrder; +} hook_struct_t; + +typedef apr_array_header_t * (*hook_get_t)(void); + +typedef struct { + const char *name; + hook_get_t get; +} hook_lookup_t; + +static hook_lookup_t request_hooks[] = { + {"Post-Read Request", ap_hook_get_post_read_request}, + {"Header Parse", ap_hook_get_header_parser}, + {"Translate Path", ap_hook_get_translate_name}, + {"Check Access", ap_hook_get_access_checker}, + {"Verify User ID", ap_hook_get_check_user_id}, + {"Verify User Access", ap_hook_get_auth_checker}, + {"Check Type", ap_hook_get_type_checker}, + {"Fixups", ap_hook_get_fixups}, + {"Logging", ap_hook_get_log_transaction}, + {NULL}, +}; + +static int module_find_hook(module *modp, + hook_get_t hook_get) +{ + int i; + apr_array_header_t *hooks = hook_get(); + hook_struct_t *elts; + + if (!hooks) { + return 0; + } + + elts = (hook_struct_t *)hooks->elts; + + for (i=0; i< hooks->nelts; i++) { + if (strcmp(elts[i].szName, modp->name) == 0) { + return 1; + } + } + + return 0; +} + +static void module_participate(request_rec *r, + module *modp, + hook_lookup_t *lookup, + int *comma) +{ + if (module_find_hook(modp, lookup->get)) { + if (*comma) { + ap_rputs(", ", r); + } + ap_rvputs(r, "", lookup->name, "", NULL); + *comma = 1; + } +} + +static void module_request_hook_participate(request_rec *r, module *modp) +{ + int i, comma=0; + + ap_rputs("
Request Phase Participation: \n", r); + + for (i=0; request_hooks[i].name; i++) { + module_participate(r, modp, &request_hooks[i], &comma); + } + + if (!comma) { + ap_rputs(" none", r); + } +} + static const char *find_more_info(server_rec *s, const char *module_name) { int i; @@ -364,7 +445,12 @@ ap_rputs(" none", r); } #else - ap_rputs(" (code broken)", r); + if (module_find_hook(modp, ap_hook_get_handler)) { + ap_rputs(" yes", r); + } + else { + ap_rputs(" none", r); + } #endif ap_rputs("
Configuration Phase Participation: \n", r); @@ -399,6 +485,9 @@ if (!comma) ap_rputs(" none", r); comma = 0; + + module_request_hook_participate(r, modp); + ap_rputs("
Module Directives: ", r); cmd = modp->cmds; if (cmd) { 1.199 +2 -0 httpd-2.0/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/httpd-2.0/CHANGES,v retrieving revision 1.198 retrieving revision 1.199 diff -u -r1.198 -r1.199 --- CHANGES 2001/05/15 02:38:08 1.198 +++ CHANGES 2001/05/15 04:25:16 1.199 @@ -1,4 +1,6 @@ Changes with Apache 2.0.18-dev + *) add "Request Phase Participation" info to mod_info + [Doug MacEachern] *) Make first phase changes to the scoreboard data structures in preparation for the rewriting of the scoreboard per my posted