httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_status.c
Date Tue, 19 Feb 2002 21:09:27 GMT
stoddard    02/02/19 13:09:27

  Modified:    .        CHANGES
               server   scoreboard.c
               include  scoreboard.h
               modules/generators mod_status.c
  Log:
  This fixes a bug in mod_status on Windows where restart time was not
  properly initialized.
  
  Move ap_restart_time into the scoreboard global area so the child process
  on non-forking platforms can have access to it.
  
  Revision  Changes    Path
  1.594     +2 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.593
  retrieving revision 1.594
  diff -u -r1.593 -r1.594
  --- CHANGES	19 Feb 2002 16:17:24 -0000	1.593
  +++ CHANGES	19 Feb 2002 21:09:26 -0000	1.594
  @@ -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]
   
  
  
  
  1.57      +1 -2      httpd-2.0/server/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/scoreboard.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- scoreboard.c	15 Feb 2002 20:48:18 -0000	1.56
  +++ scoreboard.c	19 Feb 2002 21:09:27 -0000	1.57
  @@ -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 @@
       }
       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;
   }
  
  
  
  1.41      +1 -1      httpd-2.0/include/scoreboard.h
  
  Index: scoreboard.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/scoreboard.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- scoreboard.h	15 Feb 2002 20:48:18 -0000	1.40
  +++ scoreboard.h	19 Feb 2002 21:09:27 -0000	1.41
  @@ -162,6 +162,7 @@
       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_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;
   
  
  
  
  1.52      +2 -2      httpd-2.0/modules/generators/mod_status.c
  
  Index: mod_status.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_status.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- mod_status.c	10 Jan 2002 00:28:00 -0000	1.51
  +++ mod_status.c	19 Feb 2002 21:09:27 -0000	1.52
  @@ -358,7 +358,7 @@
       }
   
       /* 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 @@
   	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);
  
  
  

Mime
View raw message