You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Michael Douglass <mi...@texas.net> on 1996/06/28 21:32:58 UTC

revised patch for mod_status.c (nodead options)

Don't ask where my brain was when I put the test inside the if/else...

--- mod_status.c        1996/06/27 18:51:22     1.2
+++ mod_status.c        1996/06/28 19:31:21
@@ -62,6 +62,7 @@
  * GET /.status?refresh=6 - Returns page with refresh every 6 seconds
  * GET /.status?auto - Returns page with data for automatic parsing
  * GET /.status?notable - Returns page with no table niceties
+ * GET /.status?nodead - Does not show dead children in table
  *
  * Mark Cox, mark@ukweb.com, November 1995
  *
@@ -153,6 +154,7 @@
 #define STAT_OPT_REFRESH       0
 #define STAT_OPT_NOTABLE       1
 #define STAT_OPT_AUTO          2
+#define STAT_OPT_NODEAD                3

 struct stat_opt
 {
@@ -168,6 +170,7 @@
        { STAT_OPT_REFRESH, "refresh", "Refresh" },
         { STAT_OPT_NOTABLE, "notable", NULL },
         { STAT_OPT_AUTO, "auto", NULL },
+        { STAT_OPT_NODEAD, "nodead", NULL },
        { STAT_OPT_END, NULL, NULL }
     };
     char *loc;
@@ -186,6 +189,7 @@
 #endif /* STATUS */
     int short_report=0;
     int no_table_report=0;
+    int no_dead_children=0;
     server_rec *server = r->server;
     short_score score_record;
     char status[]="??????????";
@@ -236,6 +240,9 @@
                       r->content_type = "text/plain";
                       short_report = 1;
                       break;
+                 case STAT_OPT_NODEAD:
+                     no_dead_children = 1;
+                     break;
                 }
            }
            i++;
@@ -398,6 +405,8 @@
        {
            if (!short_report)
            {
+               if( no_dead_children && score_record.status == SERVER_DEAD )
+                   continue;
                if (no_table_report)
                {
                    rprintf(r,"<b>Server %d</b> (%d): %d|%lu|%lu [",


Michael Douglass
Texas Networking, Inc.

  "To be a saint is to be an exception; to be a true man is the rule.
   Err, fail, sin if you must, but be upright.  To sin as little as
   possible is the law for men; to sin not at all is a dream for angels."

              - Victor Hugo, "Les Miserables"