From: Jeff Trawick Date: Sat, 27 Dec 2003 12:00:43 +0000 (+0000) Subject: Add mod_status hook to allow modules to add to the mod_status X-Git-Tag: 2.0.49~268 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=192a5ca7ff2cac59dd66a68d5a24d6330c312b1c;p=thirdparty%2Fapache%2Fhttpd.git Add mod_status hook to allow modules to add to the mod_status report. Submitted by: Joe Orton Reviewed by: trawick, ianh, jerenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102123 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 5f61b94e808..0e944585f65 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.49 + *) Add mod_status hook to allow modules to add to the mod_status + report. [Joe Orton] + *) Fix htdbm to generate comment fields in DBM files correctly. [Justin Erenkrantz] diff --git a/Makefile.in b/Makefile.in index c5d64fb4a3c..baa6c8ccce2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -174,6 +174,7 @@ install-include: @cp -p $(srcdir)/modules/dav/main/mod_dav.h $(DESTDIR)$(includedir) @cp -p $(srcdir)/modules/filters/mod_include.h $(DESTDIR)$(includedir) @cp -p $(srcdir)/modules/generators/mod_cgi.h $(DESTDIR)$(includedir) + @cp -p $(srcdir)/modules/generators/mod_status.h $(DESTDIR)$(includedir) @cp -p $(srcdir)/modules/loggers/mod_log_config.h $(DESTDIR)$(includedir) @cp -p $(srcdir)/modules/http/mod_core.h $(DESTDIR)$(includedir) @cp -p $(srcdir)/modules/proxy/mod_proxy.h $(DESTDIR)$(includedir) diff --git a/STATUS b/STATUS index 040dc4a40f2..373ceb2940a 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2003/12/27 07:41:28 $] +Last modified at [$Date: 2003/12/27 12:00:42 $] Release: @@ -336,13 +336,6 @@ PATCHES TO BACKPORT FROM 2.1 jerenkrantz: Could we do this on other platforms, too? +1: trawick, stoddard, jerenkrantz - * mod_status hook - configure.in r1.254 - Makefile.in r1.134 - modules/generators/mod_status.c r1.73 - modules/generators/mod_status.h r1.1,r1.2 - +1: trawick, ianh, jerenkrantz - CURRENT RELEASE NOTES: * Backwards compatibility is expected of future Apache 2.0 releases, diff --git a/configure.in b/configure.in index 1fb63472112..687d83a4819 100644 --- a/configure.in +++ b/configure.in @@ -135,7 +135,7 @@ if test "$abs_builddir" != "$abs_srcdir"; then APR_ADDTO(INCLUDES, [-I\$(srcdir) -I\$(top_builddir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_builddir)/include]) fi -APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/filters -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/include]) +APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/filters -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/include -I\$(top_srcdir)/modules/generators]) echo $ac_n "${nl}Applying OS-specific hints for httpd ...${nl}" diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 81e410d3cc1..c23de0e8ffd 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -107,6 +107,7 @@ #include #include "scoreboard.h" #include "http_log.h" +#include "mod_status.h" #if APR_HAVE_UNISTD_H #include #endif @@ -149,6 +150,12 @@ int server_limit, thread_limit; static pid_t child_pid; #endif +/* Implement 'ap_run_status_hook'. */ +AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(int,status_hook, + (request_rec *r, int flags), + (r, flags), + OK, DECLINED) + /* * command-related code. This is here to prevent use of ExtendedStatus * without status_module included. @@ -823,6 +830,16 @@ static int status_handler(request_rec *r) } } + { + /* Run extension hooks to insert extra content. */ + int flags = + (short_report ? AP_STATUS_SHORT : 0) | + (no_table_report ? AP_STATUS_NOTABLE : 0) | + (ap_extended_status ? AP_STATUS_EXTENDED : 0); + + ap_run_status_hook(r, flags); + } + if (!short_report) { ap_rputs(ap_psignature("
\n",r), r); ap_rputs("\n", r);