]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add mod_status hook to allow modules to add to the mod_status
authorJeff Trawick <trawick@apache.org>
Sat, 27 Dec 2003 12:00:43 +0000 (12:00 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 27 Dec 2003 12:00:43 +0000 (12:00 +0000)
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

CHANGES
Makefile.in
STATUS
configure.in
modules/generators/mod_status.c

diff --git a/CHANGES b/CHANGES
index 5f61b94e808a71c81e6002886e2e9700b90d0671..0e944585f654ff6ea3d0d8dd2aaad5a96c177980 100644 (file)
--- 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]
 
index c5d64fb4a3c4db92b17f0e3bc05fe3640b51f1e3..baa6c8ccce2ef471e1e52f1963fee7b38f004e7e 100644 (file)
@@ -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 040dc4a40f20ad2b4eb672d725f8c2abf77e83a1..373ceb2940a823f946f2ba4389bad9f283d6ccf3 100644 (file)
--- 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,
index 1fb634721122ab2145c30704126340f37e0794d7..687d83a4819f9fad4064279c985465cb8ddafcad 100644 (file)
@@ -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}"
 
index 81e410d3cc13d6d869b022b90c45be4bc667e4b5..c23de0e8ffd82943ad708cf9c5b2b6bbfe90fcc9 100644 (file)
 #include <time.h>
 #include "scoreboard.h"
 #include "http_log.h"
+#include "mod_status.h"
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>
 #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("<hr />\n",r), r);
         ap_rputs("</body></html>\n", r);