mod_status.c revision 08cecb2a91c86c409dc905266479725e3dbfb19d
* 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 "ap_mpm.h"
#include "util_script.h"
#include <time.h>
#include "scoreboard.h"
#include "http_log.h"
#include "mod_status.h"
#include <unistd.h>
#define APR_WANT_STRFUNC
#include "apr_want.h"
#ifdef NEXT
#ifdef m68k
#ifndef DEFAULT_TIME_FORMAT
(r, flags),
#ifdef HAVE_TIMES
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;
int busy;
unsigned long count;
long req_time;
#ifdef HAVE_TIMES
float tick;
int short_report;
int no_table_report;
char *stat_buffer;
return DECLINED;
#ifdef HAVE_TIMES
#ifdef _SC_CLK_TCK
ready = 0;
busy = 0;
count = 0;
bcount = 0;
kbcount = 0;
short_report = 0;
no_table_report = 0;
if (!ap_exists_scoreboard_image()) {
return HTTP_INTERNAL_SERVER_ERROR;
return DECLINED;
if (r->args) {
case STAT_OPT_REFRESH:
loc +
case STAT_OPT_NOTABLE:
case STAT_OPT_AUTO:
for (i = 0; i < server_limit; ++i) {
#ifdef HAVE_TIMES
for (j = 0; j < thread_limit; ++j) {
ready++;
busy++;
if (ap_extended_status) {
#ifdef HAVE_TIMES
if (times_per_thread) {
#ifdef HAVE_TIMES
if (!short_report) {
DEFAULT_TIME_FORMAT, 0),
(int)ap_my_generation);
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) {
/ (float) up_time));
if (count > 0) {
/ (float) count));
if (!short_report)
if (!short_report)
for (i = 0; i < server_limit; ++i) {
for (j = 0; j < thread_limit; ++j) {
&& !short_report)
if (short_report)
if (!ap_extended_status) {
for (i = 0; i < server_limit; ++i) {
for (j = 0; j < thread_limit; ++j) {
if (no_table_report)
#ifdef HAVE_TIMES
for (i = 0; i < server_limit; ++i) {
for (j = 0; j < thread_limit; ++j) {
req_time = 0L;
req_time = (long)
if (req_time < 0L)
req_time = 0L;
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_CLOSING:
case SERVER_DEAD:
case SERVER_GRACEFUL:
case SERVER_IDLE_KILL:
#ifdef HAVE_TIMES
#ifdef HAVE_TIMES
(long) req_time);
ap_rprintf(r,
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_CLOSING:
case SERVER_DEAD:
case SERVER_GRACEFUL:
case SERVER_IDLE_KILL:
ap_rprintf(r,
#ifdef HAVE_TIMES
#ifdef HAVE_TIMES
(long)req_time);
ap_rprintf(r,
ap_rprintf(r,
if (!no_table_report) {
#ifdef HAVE_TIMES
if (!short_report) {
int flags =
if (!short_report) {
server_rec *s)
return OK;
#ifdef HAVE_TIMES
#ifdef HAVE_TIMES