httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Douglass <miked...@texas.net>
Subject non-bug related patch for mod_status.c
Date Thu, 27 Jun 1996 16:37:09 GMT
I love the information that mod_status gives you; but I thought it might be
useful for an administrator to be able to click on a given request shown in
the table and go directly to that document.  So a quick snip here and a
quick snip there we cut out the URL.  (I use RCS locally whenever I modify
code so here's a diff).

diff -u -r1.1 mod_status.c
--- mod_status.c        1996/06/26 22:44:45     1.1
+++ mod_status.c        1996/06/27 16:19:28
@@ -191,6 +191,9 @@
     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;

@@ -483,8 +486,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