mod_status.c revision 066877f1a045103acfdd376d48cdd473c33f409b
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek/* ====================================================================
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * The Apache Software License, Version 1.1
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * Copyright (c) 2000 The Apache Software Foundation. All rights
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * Redistribution and use in source and binary forms, with or without
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * modification, are permitted provided that the following conditions
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * 1. Redistributions of source code must retain the above copyright
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * notice, this list of conditions and the following disclaimer.
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * 2. Redistributions in binary form must reproduce the above copyright
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * notice, this list of conditions and the following disclaimer in
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * the documentation and/or other materials provided with the
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * 3. The end-user documentation included with the redistribution,
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * if any, must include the following acknowledgment:
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * "This product includes software developed by the
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * Apache Software Foundation (http://www.apache.org/)."
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * Alternately, this acknowledgment may appear in the software itself,
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * if and wherever such third-party acknowledgments normally appear.
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * 4. The names "Apache" and "Apache Software Foundation" must
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * not be used to endorse or promote products derived from this
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * software without prior written permission. For written
9ff48d0982fcb97923955685fe9fa4e0e67cb238Zbigniew Jędrzejewski-Szmek * permission, please contact apache@apache.org.
* 12.11.95 Initial version for www.telescope.org
#define CORE_PRIVATE
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_main.h"
#include "util_script.h"
#include <time.h>
#include "scoreboard.h"
#include "http_log.h"
#ifdef NEXT
#ifdef m68k
#ifndef DEFAULT_TIME_FORMAT
return err;
return NULL;
{NULL}
if (days)
if (hrs)
if (mins)
if (secs)
#define STAT_OPT_REFRESH 0
struct stat_opt {
int id;
const char *form_data_str;
const char *hdr_out_str;
const char *loc;
int j, i, res;
int ready = 0;
int busy = 0;
unsigned long count = 0;
unsigned short conn_lres;
unsigned long bcount = 0;
unsigned long kbcount = 0;
long req_time;
#ifdef HAVE_TIMES
#ifdef _SC_CLK_TCK
int short_report = 0;
int no_table_report = 0;
return DECLINED;
if (!ap_exists_scoreboard_image()) {
return HTTP_INTERNAL_SERVER_ERROR;
return DECLINED;
if (r->args) {
case STAT_OPT_REFRESH:
case STAT_OPT_NOTABLE:
case STAT_OPT_AUTO:
if (r->header_only)
for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
for (j = 0; j < HARD_THREAD_LIMIT; ++j) {
ready++;
busy++;
if (ap_extended_status) {
#ifdef HAVE_TIMES
if (!short_report) {
if (ap_extended_status) {
if (short_report) {
#ifdef HAVE_TIMES
if (up_time > 0)
if (up_time > 0)
if (count > 0)
#ifdef HAVE_TIMES
if (up_time > 0)
if (up_time > 0) {
if (count > 0) {
if (!short_report)
if (!short_report)
for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
for (j = 0; j < HARD_THREAD_LIMIT; ++j) {
if (short_report)
if (!ap_extended_status) {
for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
for (k = 0; k < HARD_THREAD_LIMIT; ++k) {
if (ap_extended_status) {
if (!short_report) {
if (no_table_report)
#ifndef HAVE_TIMES
ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Client<th>VHost<th>Request</tr>\n\n", r);
ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M<th>CPU\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Client<th>VHost<th>Request</tr>\n\n", r);
for (i = 0; i < HARD_SERVER_LIMIT; ++i) {
for (j = 0; j < HARD_THREAD_LIMIT; ++j) {
#if defined(NO_GETTIMEOFDAY)
#ifdef HAVE_TIMES
req_time = 0L;
#ifdef HAVE_TIMES
req_time = 0L;
req_time =
if (req_time < 0L)
req_time = 0L;
if (!short_report) {
if (no_table_report) {
ap_rprintf(r,
ap_rprintf(r,
case SERVER_READY:
case SERVER_STARTING:
case SERVER_BUSY_READ:
case SERVER_BUSY_WRITE:
case SERVER_BUSY_KEEPALIVE:
case SERVER_BUSY_LOG:
case SERVER_BUSY_DNS:
case SERVER_DEAD:
case SERVER_GRACEFUL:
#ifndef HAVE_TIMES
#ifdef OPTIMIZE_TIMEOUTS
(long) req_time);
ap_rprintf(r,
ap_rprintf(r,
case SERVER_READY:
case SERVER_STARTING:
case SERVER_BUSY_READ:
case SERVER_BUSY_WRITE:
case SERVER_BUSY_KEEPALIVE:
case SERVER_BUSY_LOG:
case SERVER_BUSY_DNS:
case SERVER_DEAD:
case SERVER_GRACEFUL:
#ifndef HAVE_TIMES
#ifdef OPTIMIZE_TIMEOUTS
(long) req_time);
ap_rprintf(r,
ap_rprintf(r,
#ifndef HAVE_TIMES
if (!short_report) {
if (!short_report) {