]> granicus.if.org Git - apache/commitdiff
This fixes a bug in mod_status on Windows where restart time was not
authorBill Stoddard <stoddard@apache.org>
Tue, 19 Feb 2002 21:09:27 +0000 (21:09 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 19 Feb 2002 21:09:27 +0000 (21:09 +0000)
properly initialized.

Move ap_restart_time into the scoreboard global area so the child process
on non-forking platforms can have access to it.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93502 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
include/scoreboard.h
modules/generators/mod_status.c
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index ac639a4531a609638569176a7ab7ad19d5cdaa48..cfbe8664e67558d2c2169e46b3b999d348773b82 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,6 @@
 Changes with Apache 2.0.33-dev
+  *) Win32: Fix bug in mod_status with displaying "Restart Time"
+     [Bill Stoddard]
 
   *) Fix IPv6 name-based virtual hosts.  [Jeff Trawick]
 
index 6001caf078f775e8c6e256134e4732dd865ddf8b..bbb3b2f016b93297d2471bc8dab444ade65791c9 100644 (file)
@@ -162,6 +162,7 @@ typedef struct {
     ap_scoreboard_e sb_type;
     ap_generation_t running_generation;        /* the generation of children which
                                          * should still be serving requests. */
+    apr_time_t restart_time;
 } global_score;
 
 /* stuff which the parent generally writes and the children rarely read */
@@ -214,7 +215,6 @@ AP_DECLARE(global_score *) ap_get_scoreboard_global(void);
 AP_DECLARE_DATA extern scoreboard *ap_scoreboard_image;
 AP_DECLARE_DATA extern const char *ap_scoreboard_fname;
 AP_DECLARE_DATA extern int ap_extended_status;
-AP_DECLARE_DATA extern apr_time_t ap_restart_time;
 
 AP_DECLARE_DATA extern ap_generation_t volatile ap_my_generation;
 
index 6970243d541b2b77b8594da0af3ff071a8033552..81a813ff782db27f3c48ce22b85007441315df76 100644 (file)
@@ -358,7 +358,7 @@ static int status_handler(request_rec *r)
     }
 
     /* up_time in seconds */
-    up_time = (apr_uint32_t) ((nowtime - ap_restart_time)/APR_USEC_PER_SEC);
+    up_time = (apr_uint32_t) ((nowtime - ap_scoreboard_image->global->restart_time)/APR_USEC_PER_SEC);
 
     if (!short_report) {
        ap_rputs(DOCTYPE_HTML_3_2
@@ -373,7 +373,7 @@ static int status_handler(request_rec *r)
        ap_rvputs(r, "<dt>Current Time: ",
          ap_ht_time(r->pool, nowtime, DEFAULT_TIME_FORMAT, 0), "</dt>\n", NULL);
        ap_rvputs(r, "<dt>Restart Time: ",
-         ap_ht_time(r->pool, ap_restart_time, DEFAULT_TIME_FORMAT, 0), 
+         ap_ht_time(r->pool, ap_scoreboard_image->global->restart_time, DEFAULT_TIME_FORMAT, 0), 
          "</dt>\n", NULL);
        ap_rprintf(r, "<dt>Parent Server Generation: %d</dt>\n", (int) ap_my_generation);
        ap_rputs("<dt>Server uptime: ", r);
index 744fd429058fe8f9a4267b167922c7a71ea653eb..f10651dae107fbec6d0a548ca8f078bd46aae75e 100644 (file)
@@ -82,7 +82,6 @@
 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;
 
 #if APR_HAS_SHARED_MEMORY
 
@@ -319,7 +318,7 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
     }
     ap_scoreboard_image->global->sb_type = sb_type;
     ap_scoreboard_image->global->running_generation = running_gen;
-    ap_restart_time = apr_time_now();
+    ap_scoreboard_image->global->restart_time = apr_time_now();
     apr_pool_cleanup_register(p, NULL, ap_cleanup_scoreboard, apr_pool_cleanup_null);
     return OK;
 }