Commit 26e4ba72 authored by Bill Stoddard's avatar Bill Stoddard
Browse files

More mod_status work... Get Current Time, Restart Time and Server uptime

displaying properly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87972 13f79535-47bb-0310-9956-ffa450edef68
parent 900b520e
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -177,10 +177,13 @@ static void format_kbyte_out(request_rec *r, unsigned long kbytes)
	ap_rprintf(r, "%.1f GB", (float) kbytes / MBYTE);
}

static void show_time(request_rec *r, time_t tsecs)
static void show_time(request_rec *r, apr_time_t tsecs) 
{
    long days, hrs, mins, secs;
    
    /* convert apr_time_t (in micro seconds) to seconds */
    tsecs = tsecs/1000000;

    secs = tsecs % 60;
    tsecs /= 60;
    mins = tsecs % 60;
@@ -225,7 +228,7 @@ static char status_flags[SERVER_NUM_STATUS];
static int status_handler(request_rec *r)
{
    const char *loc;
    time_t nowtime = time(NULL);
    apr_time_t nowtime = apr_now();
    time_t up_time;
    int j, i, res;
    int ready = 0;
+2 −2
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ static int ap_threads_to_start=0;
static int min_spare_threads=0;
static int max_spare_threads=0;
static int ap_thread_limit=0;
static time_t ap_restart_time=0;
static apr_time_t ap_restart_time=0;
AP_DECLARE_DATA int ap_extended_status = 0;
static int num_listening_sockets = 0; /* set by open_listeners in ap_mpm_run */
static apr_socket_t ** listening_sockets;
@@ -797,7 +797,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
    }
    
    if (!is_graceful) {
        ap_restart_time = time(NULL); 
        ap_restart_time = apr_now();
    }

    /* just before we go, tidy up the locks we've created to prevent a 
+2 −2
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ static int ap_daemons_to_start=0;
static int min_spare_threads=0;
static int max_spare_threads=0;
static int ap_daemons_limit=0;
static time_t ap_restart_time=0;
static apr_time_t ap_restart_time=0;
AP_DECLARE_DATA int ap_extended_status = 0;
static int workers_may_exit = 0;
static int requests_this_child;
@@ -809,7 +809,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
		    "SIGHUP received.  Attempting to restart");
    }
    if (!is_graceful) {
        ap_restart_time = time(NULL); 
        ap_restart_time = apr_now();
    }
    delete_port(port_of_death);
    return 0;
+1 −1
Original line number Diff line number Diff line
@@ -1148,7 +1148,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
		    "SIGHUP received.  Attempting to restart");
    }
    if (!is_graceful) {
        ap_restart_time = time(NULL); 
        ap_restart_time = apr_now();
    }
    return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -1283,7 +1283,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
    }

    if (!is_graceful) {
	ap_restart_time = time(NULL);
	ap_restart_time = apr_now();
    }

    return 0;
Loading