Index: include/http_request.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/http_request.h,v
retrieving revision 1.28
diff -u -r1.28 http_request.h
--- include/http_request.h	2001/03/25 17:38:18	1.28
+++ include/http_request.h	2001/06/07 21:48:56
@@ -317,6 +317,14 @@
  * @ingroup hooks
  */
 AP_DECLARE_HOOK(void,insert_filter,(request_rec *r))
+/**
+ * This routine is called to set fields for the status 
+ * @param r the current request
+ * @param table the place to put the results
+ * @ingroup hooks
+ */
+
+AP_DECLARE_HOOK(void, server_status, (request_rec *r, apr_table_t*desc,apr_table_t*val))
 
 AP_DECLARE(int) directory_walk(request_rec *r);
 AP_DECLARE(int) location_walk(request_rec *r);
Index: modules/generators/mod_status.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_status.c,v
retrieving revision 1.39
diff -u -r1.39 mod_status.c
--- modules/generators/mod_status.c	2001/05/31 18:10:04	1.39
+++ modules/generators/mod_status.c	2001/06/07 21:49:10
@@ -101,6 +101,7 @@
 #include "http_config.h"
 #include "http_core.h"
 #include "http_protocol.h"
+#include "http_request.h"
 #include "http_main.h"
 #include "util_script.h"
 #include <time.h>
@@ -111,6 +112,7 @@
 #endif
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
+#include "apr_tables.h"
 
 #ifdef NEXT
 #if (NX_CURRENT_COMPILER_RELEASE == 410)
@@ -242,6 +244,7 @@
     unsigned long bcount = 0;
     unsigned long kbcount = 0;
     long req_time;
+	int k;
 #ifdef HAVE_TIMES
 #ifdef _SC_CLK_TCK
     float tick = sysconf(_SC_CLK_TCK);
@@ -257,6 +260,10 @@
     pid_t pid_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
     clock_t tu, ts, tcu, tcs;
     server_rec *vhost;
+	apr_table_t *desc;
+	apr_table_t *value;
+	apr_array_header_t *status_value_array;
+	apr_table_entry_t *status_value;
 
     if (strcmp(r->handler, STATUS_MAGIC_TYPE) && strcmp(r->handler, "server-status")) {
         return DECLINED;
@@ -311,8 +318,19 @@
 
     if (r->header_only)
 	return 0;
-
+	desc = apr_table_make(r->pool,10);
+	value = apr_table_make(r->pool,10);
+	ap_run_server_status(r,desc,value);
+
+	status_value_array = apr_table_elts(desc);
+    status_value = (apr_table_entry_t *) status_value_array->elts;
+
+	for (k=0;k< status_value_array->nelts;k++) {
+		ap_rprintf(r,"<b>%s</b> (%s) <b>%s</b><br>",
+				status_value[k].key, status_value[k].val,apr_table_get(value,status_value[k].key ));
+	}
 /*    ap_sync_scoreboard_image(); */
+
     for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
         for (j = 0; j < HARD_THREAD_LIMIT; ++j) {
             int indx = (i * HARD_THREAD_LIMIT) + j;
@@ -370,7 +388,7 @@
 	show_time(r, up_time);
 	ap_rputs("<br>\n", r);
     }
-
+	
     if (ap_extended_status) {
 	if (short_report) {
 	    ap_rprintf(r, "Total Accesses: %lu\nTotal kBytes: %lu\n",
Index: server/request.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/request.c,v
retrieving revision 1.6
diff -u -r1.6 request.c
--- server/request.c	2001/06/07 03:02:03	1.6
+++ server/request.c	2001/06/07 21:49:28
@@ -99,7 +99,8 @@
 	    APR_HOOK_LINK(access_checker)
 	    APR_HOOK_LINK(auth_checker)
 	    APR_HOOK_LINK(insert_filter)
-            APR_HOOK_LINK(create_request)
+		APR_HOOK_LINK(server_status)
+        APR_HOOK_LINK(create_request)
 )
 
 AP_IMPLEMENT_HOOK_RUN_FIRST(int,translate_name,
@@ -115,6 +116,8 @@
 AP_IMPLEMENT_HOOK_RUN_FIRST(int,auth_checker,
                             (request_rec *r),(r),DECLINED)
 AP_IMPLEMENT_HOOK_VOID(insert_filter, (request_rec *r), (r))
+AP_IMPLEMENT_HOOK_VOID(server_status, (request_rec *r,apr_table_t *v, apr_table_t *d), (r,v,d))
+
 AP_IMPLEMENT_HOOK_RUN_ALL(int,create_request,(request_rec *r),(r),OK,DECLINED)
 
 /*****************************************************************
Index: server/scoreboard.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/scoreboard.c,v
retrieving revision 1.24
diff -u -r1.24 scoreboard.c
--- server/scoreboard.c	2001/05/22 01:31:12	1.24
+++ server/scoreboard.c	2001/06/07 21:49:28
@@ -72,18 +72,21 @@
 #include "httpd.h"
 #include "http_log.h"
 #include "http_main.h"
+#include "http_request.h"
 #include "http_core.h"
 #include "http_config.h"
 #include "ap_mpm.h"
 
 #include "mpm.h"
 #include "scoreboard.h"
+#include "status_hook.h"
 
 AP_DECLARE_DATA scoreboard *ap_scoreboard_image = NULL;
 AP_DECLARE_DATA const char *ap_scoreboard_fname=NULL;
 AP_DECLARE_DATA int ap_extended_status = 0;
 AP_DECLARE_DATA apr_time_t ap_restart_time = 0;
 
+static void ap_scoreboard_status_hook(request_rec *r, apr_table_t *desc, apr_table_t *val);
 #if APR_HAS_SHARED_MEMORY
 #include "apr_shmem.h"
 static apr_shmem_t *scoreboard_shm = NULL;
@@ -189,6 +192,7 @@
     ap_scoreboard_image->global.running_generation = running_gen;
     ap_restart_time = apr_time_now();
     apr_pool_cleanup_register(p, NULL, ap_cleanup_scoreboard, apr_pool_cleanup_null);
+	ap_hook_server_status(ap_scoreboard_status_hook, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
 /* Routines called to deal with the scoreboard image
@@ -340,3 +344,70 @@
     put_scoreboard_info(child_num, thread_num, ws);
 }
 
+static void ap_scoreboard_status_hook(request_rec *r, apr_table_t *desc, apr_table_t *val) 
+{
+    worker_score ws_record;
+    process_score ps_record;
+#ifdef HAVE_TIMES
+	clock_t tu, ts, tcu, tcs;
+#endif /* HAVE_TIMES */
+	int j, i, res;
+    unsigned long count = 0;
+    unsigned long lres, bytes;
+    int ready = 0;
+    int busy = 0;
+    char stat_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
+	pid_t pid_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
+    unsigned long bcount = 0;
+    unsigned long kbcount = 0;
+
+    for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
+        for (j = 0; j < HARD_THREAD_LIMIT; ++j) {
+            int indx = (i * HARD_THREAD_LIMIT) + j;
+
+	    ws_record = ap_scoreboard_image->servers[i][j];
+	    ps_record = ap_scoreboard_image->parent[i];
+	    res = ws_record.status;
+	    stat_buffer[indx] = res;
+	    pid_buffer[indx] = ps_record.pid;
+	    if (res == SERVER_READY)
+	        ready++;
+	    else if (res != SERVER_DEAD && res != SERVER_IDLE_KILL)
+	        busy++;
+	    if (ap_extended_status) {
+	        lres = ws_record.access_count;
+	        bytes = ws_record.bytes_served;
+	        if (lres != 0 || (res != SERVER_READY && res != SERVER_DEAD)) {
+#ifdef HAVE_TIMES
+		    tu += ws_record.times.tms_utime;
+		    ts += ws_record.times.tms_stime;
+		    tcu += ws_record.times.tms_cutime;
+		    tcs += ws_record.times.tms_cstime;
+#endif /* HAVE_TIMES */
+		    count += lres;
+		    bcount += bytes;
+		    if (bcount >= KBYTE) {
+		        kbcount += (bcount >> 10);
+		        bcount = bcount & 0x3ff;
+		    }
+	        }
+	    }
+        }
+    }
+#ifdef HAVE_TIMES
+	apr_table_setn(val,"tu",apr_psprintf(r->pool,"%g",tu));
+
+	apr_table_setn(val,"ts",apr_psprintf(r->pool,"%g",ts));
+	apr_table_setn(val,"tcu",apr_psprintf(r->pool,"%g",tcu));
+	apr_table_setn(val,"tcs",apr_psprintf(r->pool,"%g",tcs));
+	apr_table_setn(desc,"tu","utime");
+	apr_table_setn(desc,"ts","stime");
+	apr_table_setn(desc,"tcu","cutime");
+	apr_table_setn(desc,"tsu","cstime");
+
+#endif
+	apr_table_setn(val,"ready",apr_psprintf(r->pool,"%d",ready));
+	apr_table_setn(val,"busy",apr_psprintf(r->pool,"%d",busy));
+	apr_table_setn(desc,"ready","idle servers");
+	apr_table_setn(desc,"busy","requests currently being processed");
+}
