httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Douglass <miked...@texas.net>
Subject Re: Status patch for 1.2
Date Fri, 12 Jul 1996 22:45:33 GMT
On Thu, 11 Jul 1996, Jim Jagielski wrote:

> I'd like to propose this patch for 1.2.

While you're doing patches on mod_status, here's the one I worked up in the
final 1.1beta stages.  Actually two patches in one.

1) ?nodead option to ignore dead servers in the tablized output.  This
   option makes it easier to see the active server activity.

2) Adds an <A HREF> tag around GET documents listed in tabelized output.

--- mod_status.c        1996/07/09 16:05:50     1.1
+++ mod_status.c        1996/07/09 16:06:04
@@ -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
  *
@@ -157,6 +158,7 @@
 #define STAT_OPT_REFRESH       0
 #define STAT_OPT_NOTABLE       1
 #define STAT_OPT_AUTO          2
+#define STAT_OPT_NODEAD                3

 struct stat_opt
 {
@@ -172,6 +174,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;
@@ -194,11 +197,15 @@
 #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[]="??????????";
     char stat_buffer[HARD_SERVER_LIMIT];
     clock_t tu,ts,tcu,tcs;
+    char *server_url;
+    char *tmp;
+    int url_size;

     tu=ts=tcu=tcs=0;

@@ -241,6 +248,9 @@
                       r->content_type = "text/plain";
                       short_report = 1;
                       break;
+                 case STAT_OPT_NODEAD:
+                     no_dead_children = 1;
+                     break;
                 }
            }
            i++;
@@ -403,6 +413,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 [",
@@ -491,8 +503,23 @@
                    rprintf(r,"<td>%-1.1f<td>%-2.2f<td>%-2.2f\n",
                        (float)conn_bytes/KBYTE, (float)my_bytes/MBYTE,
                        (float)bytes/MBYTE);
-                   rprintf(r,"<td>%s<td nowrap>%s</tr>\n\n",
-                       score_record.client, score_record.request);
+                   rprintf(r,"<td>%s<td nowrap>", score_record.client );
+                   if ( ! strncmp( score_record.request, "GET", 3 ) ) {
+
+                       tmp = strchr( score_record.request + 4, ' ' );
+                       if ( tmp )
+                           url_size = tmp - score_record.request - 4;
+                       else
+                           url_size = strlen( score_record.request ) - 4 ;
+
+                       server_url = pstrndup( r->pool,score_record.request + 4,
+                           url_size + 1 );
+                        server_url[ url_size ] = '\0';
+                       rprintf( r,"<A HREF=\"%s\">%s</A></tr>\n\n",
+                       server_url, score_record.request);
+                   } else {
+                       rprintf( r,"%s</tr>\n\n", score_record.request);
+                   }
                }       /* no_table_report */
            }           /* !short_report */
        }               /* if (<active child>) */

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"


Mime
View raw message