#define SERVER_IDLE_KILL 11 /* Server is cleaning up idle children. */
#define SERVER_NUM_STATUS 12 /* number of status settings */
-/* A "virtual time" is simply a counter that indicates that a child is
- * making progress. The parent checks up on each child, and when they have
- * made progress it resets the last_rtime element. But when the child hasn't
- * made progress in a time that's roughly timeout_len seconds long, it is
- * sent a SIGALRM.
- *
- * vtime is an optimization that is used only when the scoreboard is in
- * shared memory (it's not easy/feasible to do it in a scoreboard file).
- * The essential observation is that timeouts rarely occur, the vast majority
- * of hits finish before any timeout happens. So it really sucks to have to
- * ask the operating system to set up and destroy alarms many times during
- * a request.
- */
-typedef unsigned vtime_t;
-
/* Type used for generation indicies. Startup and every restart cause a
* new generation of children to be spawned. Children within the same
* generation share the same configuration information -- pointers to stuff
#ifdef HAVE_TIMES
struct tms times;
#endif
- time_t last_used;
+ apr_time_t last_used;
char client[32]; /* Keep 'em small... */
char request[64]; /* We just want an idea... */
server_rec *vhostrec; /* What virtual host is being accessed? */
short_score score_record;
parent_score ps_record;
char stat_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
- int pid_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
+ pid_t pid_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT];
clock_t tu, ts, tcu, tcs;
server_rec *vhost;
ps_record = ap_scoreboard_image->parent[i];
res = score_record.status;
stat_buffer[indx] = status_flags[res];
- pid_buffer[indx] = (int) ps_record.pid;
+ pid_buffer[indx] = ps_record.pid;
if (res == SERVER_READY)
ready++;
else if (res != SERVER_DEAD)
}
/* up_time in seconds */
- up_time = (apr_uint32_t) ((nowtime - ap_restart_time)/1000000);
+ up_time = (apr_uint32_t) ((nowtime - ap_restart_time)/APR_USEC_PER_SEC);
if (!short_report) {
ap_rputs(DOCTYPE_HTML_3_2
int indx = (i * HARD_THREAD_LIMIT) + j;
if (stat_buffer[indx] != '.') {
- ap_rprintf(r, " %d in state: %c ", pid_buffer[i],
- stat_buffer[indx]);
+ ap_rprintf(r, " %" APR_OS_PROC_T_FMT
+ " in state: %c ", pid_buffer[i],
+ stat_buffer[indx]);
if (++k >= 3) {
ap_rputs("\n", r);
k = 0;
my_lres, lres);
else
ap_rprintf(r,
- "<b>Server %d-%d</b> (%d): %d|%lu|%lu [",
+ "<b>Server %d-%d</b> (%" APR_OS_PROC_T_FMT
+ "): %d|%lu|%lu [",
i, (int) ps_record.generation,
- (int) ps_record.pid,
+ ps_record.pid,
(int) conn_lres, my_lres, lres);
switch (score_record.status) {
ap_rprintf(r, "]\n %.0f %ld (",
#else
- ap_rprintf(r, "] u%g s%g cu%g cs%g\n %.0f %ld (",
+ ap_rprintf(r, "] u%g s%g cu%g cs%g\n %ld %ld (",
score_record.times.tms_utime / tick,
score_record.times.tms_stime / tick,
score_record.times.tms_cutime / tick,
score_record.times.tms_cstime / tick,
#endif
- difftime(nowtime, score_record.last_used),
+ (long)((nowtime - score_record.last_used) / APR_USEC_PER_SEC),
(long) req_time);
format_byte_out(r, conn_bytes);
ap_rputs("|", r);
(int) conn_lres, my_lres, lres);
else
ap_rprintf(r,
- "<tr><td><b>%d-%d</b><td>%d<td>%d/%lu/%lu",
+ "<tr><td><b>%d-%d</b><td>%" APR_OS_PROC_T_FMT
+ "<td>%d/%lu/%lu",
i, (int) ps_record.generation,
- (int) ps_record.pid, (int) conn_lres,
+ ps_record.pid, (int) conn_lres,
my_lres, lres);
switch (score_record.status) {
/* Allow for OS/2 not having CPU stats */
ap_rprintf(r, "\n<td>%.0f<td>%ld",
#else
- ap_rprintf(r, "\n<td>%.2f<td>%.0f<td>%ld",
+ ap_rprintf(r, "\n<td>%.2f<td>%ld<td>%ld",
(score_record.times.tms_utime +
score_record.times.tms_stime +
score_record.times.tms_cutime +
score_record.times.tms_cstime) / tick,
#endif
- difftime(nowtime, score_record.last_used),
+ (long)((nowtime - score_record.last_used) / APR_USEC_PER_SEC),
(long) req_time);
ap_rprintf(r, "<td>%-1.1f<td>%-2.2f<td>%-2.2f\n",
(float) conn_bytes / KBYTE, (float) my_bytes / MBYTE,