]> granicus.if.org Git - apache/commitdiff
Merge r1671397, r1672466, r1672564 from trunk:
authorJim Jagielski <jim@apache.org>
Sun, 19 Apr 2015 18:05:15 +0000 (18:05 +0000)
committerJim Jagielski <jim@apache.org>
Sun, 19 Apr 2015 18:05:15 +0000 (18:05 +0000)
Add output for "?auto" version of server-status
to proxy status, mod_ssl session cache info,
mod_cache_socache and the status hook of the
individual socache implementations.

Followon to r1671397 for proxy server-status
in auto mode:
- don't show HTML legend
- Show correct worker name

More followon to r1671397 for proxy server-status
in auto mode:
- remove remaining HTML markup

Submitted by: rjung
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1674660 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/cache/mod_cache_socache.c
modules/cache/mod_socache_dbm.c
modules/cache/mod_socache_dc.c
modules/cache/mod_socache_shmcb.c
modules/proxy/mod_proxy.c
modules/ssl/ssl_scache.c

diff --git a/STATUS b/STATUS
index b8379e56062ebc6fc893b3837b5a0253b56b9bf7..716790f6f5ce98615ae9a8323a3dbcc8d4b7053d 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -105,16 +105,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_ssl, mod_proxy, mod_cache_socache, mod_socache_*: Add plain text
-     output to status hook (server-status) when called with "?auto"
-     (machine readable form).
-     trunk patch: http://svn.apache.org/r1671397
-                  http://svn.apache.org/r1672466
-                  http://svn.apache.org/r1672564
-     2.4.x patch: http://people.apache.org/~rjung/patches/enhance-socache-status-auto.patch
-                  (same as trunk but combined into one)
-     +1: rjung, covener, jim
-
   *) mod_proxy_wstunnel: Bypass the handler while the connection is not
      upgraded to WebSocket, so that other modules can possibly take over
      the leading HTTP requests.
index 6bd9466bd19d683832c117a4fc43381bbc18f27c..c5b49ab998f252e6d53209ed1ef676e64fea7220 100644 (file)
@@ -1387,13 +1387,18 @@ static int socache_status_hook(request_rec *r, int flags)
         return DECLINED;
     }
 
-    ap_rputs("<hr>\n"
-             "<table cellspacing=0 cellpadding=0>\n"
-             "<tr><td bgcolor=\"#000000\">\n"
-             "<b><font color=\"#ffffff\" face=\"Arial,Helvetica\">"
-             "mod_cache_socache Status:</font></b>\n"
-             "</td></tr>\n"
-             "<tr><td bgcolor=\"#ffffff\">\n", r);
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rputs("<hr>\n"
+                 "<table cellspacing=0 cellpadding=0>\n"
+                 "<tr><td bgcolor=\"#000000\">\n"
+                 "<b><font color=\"#ffffff\" face=\"Arial,Helvetica\">"
+                 "mod_cache_socache Status:</font></b>\n"
+                 "</td></tr>\n"
+                 "<tr><td bgcolor=\"#ffffff\">\n", r);
+    }
+    else {
+        ap_rputs("ModCacheSocacheStatus\n", r);
+    }
 
     if (socache_mutex) {
         status = apr_global_mutex_lock(socache_mutex);
@@ -1404,7 +1409,12 @@ static int socache_status_hook(request_rec *r, int flags)
     }
 
     if (status != APR_SUCCESS) {
-        ap_rputs("No cache status data available\n", r);
+        if (!(flags & AP_STATUS_SHORT)) {
+            ap_rputs("No cache status data available\n", r);
+        }
+        else {
+            ap_rputs("NotAvailable\n", r);
+        }
     } else {
         conf->provider->socache_provider->status(conf->provider->socache_instance,
                                                  r, flags);
@@ -1418,7 +1428,9 @@ static int socache_status_hook(request_rec *r, int flags)
         }
     }
 
-    ap_rputs("</td></tr>\n</table>\n", r);
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rputs("</td></tr>\n</table>\n", r);
+    }
     return OK;
 }
 
index 0d7c302bafa031456cde978545ef0bb64a360cb8..1ffc60077176fe0d775193cd74f18bd46b1eda3d 100644 (file)
@@ -20,6 +20,7 @@
 #include "http_protocol.h"
 #include "http_config.h"
 #include "mpm_common.h"
+#include "mod_status.h"
 
 #include "apr.h"
 #include "apr_strings.h"
@@ -497,9 +498,18 @@ static void socache_dbm_status(ap_socache_instance_t *ctx, request_rec *r,
         avg = (int)(size / (long)elts);
     else
         avg = 0;
-    ap_rprintf(r, "cache type: <b>DBM</b>, maximum size: <b>unlimited</b><br>");
-    ap_rprintf(r, "current entries: <b>%d</b>, current size: <b>%ld</b> bytes<br>", elts, size);
-    ap_rprintf(r, "average entry size: <b>%d</b> bytes<br>", avg);
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rprintf(r, "cache type: <b>DBM</b>, maximum size: <b>unlimited</b><br>");
+        ap_rprintf(r, "current entries: <b>%d</b>, current size: <b>%ld</b> bytes<br>", elts, size);
+        ap_rprintf(r, "average entry size: <b>%d</b> bytes<br>", avg);
+    }
+    else {
+        ap_rputs("CacheType: DBM\n", r);
+        ap_rputs("CacheMaximumSize: unlimited\n", r);
+        ap_rprintf(r, "CacheCurrentEntries: %d\n", elts);
+        ap_rprintf(r, "CacheCurrentSize: %ld\n", size);
+        ap_rprintf(r, "CacheAvgEntrySize: %d\n", avg);
+    }
     return;
 }
 
index 7d09408d6e1ea490f3786edc044c1f1194902607..c1d4ab841ecdbacc693b554c542ef8fe5e17febc 100644 (file)
@@ -19,6 +19,7 @@
 #include "http_request.h"
 #include "http_config.h"
 #include "http_protocol.h"
+#include "mod_status.h"
 
 #include "apr_strings.h"
 #include "apr_time.h"
@@ -151,8 +152,14 @@ static void socache_dc_status(ap_socache_instance_t *ctx, request_rec *r, int fl
 {
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00747)
                   "distributed scache 'socache_dc_status'");
-    ap_rprintf(r, "cache type: <b>DC (Distributed Cache)</b>, "
-               " target: <b>%s</b><br>", ctx->target);
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rprintf(r, "cache type: <b>DC (Distributed Cache)</b>, "
+                   " target: <b>%s</b><br>", ctx->target);
+    }
+    else {
+        ap_rputs("CacheType: DC\n", r);
+        ap_rvputs(r, "CacheTarget: ", ctx->target, "\n", NULL);
+    }
 }
 
 static apr_status_t socache_dc_iterate(ap_socache_instance_t *instance,
index 4e8937750c825d2b97bb23709ac1d803c427f624..2731b81345180525afd9ebd59efbebb01d95d6aa 100644 (file)
@@ -19,6 +19,7 @@
 #include "http_request.h"
 #include "http_protocol.h"
 #include "http_config.h"
+#include "mod_status.h"
 
 #include "apr.h"
 #include "apr_strings.h"
@@ -606,40 +607,69 @@ static void socache_shmcb_status(ap_socache_instance_t *ctx,
                                  header->subcache_num);
     cache_pct = (100 * cache_total) / (header->subcache_data_size *
                                        header->subcache_num);
-    /* Generate HTML */
-    ap_rprintf(r, "cache type: <b>SHMCB</b>, shared memory: <b>%" APR_SIZE_T_FMT "</b> "
-               "bytes, current entries: <b>%d</b><br>",
-               ctx->shm_size, total);
-    ap_rprintf(r, "subcaches: <b>%d</b>, indexes per subcache: <b>%d</b><br>",
-               header->subcache_num, header->index_num);
-    if (non_empty_subcaches) {
-        apr_time_t average_expiry = (apr_time_t)(expiry_total / (double)non_empty_subcaches);
-        ap_rprintf(r, "time left on oldest entries' objects: ");
-        if (now < average_expiry)
-            ap_rprintf(r, "avg: <b>%d</b> seconds, (range: %d...%d)<br>",
-                       (int)apr_time_sec(average_expiry - now),
-                       (int)apr_time_sec(min_expiry - now),
-                       (int)apr_time_sec(max_expiry - now));
-        else
-            ap_rprintf(r, "expiry_threshold: <b>Calculation error!</b><br>");
+    /* Generate Output */
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rprintf(r, "cache type: <b>SHMCB</b>, shared memory: <b>%" APR_SIZE_T_FMT "</b> "
+                   "bytes, current entries: <b>%d</b><br>",
+                   ctx->shm_size, total);
+        ap_rprintf(r, "subcaches: <b>%d</b>, indexes per subcache: <b>%d</b><br>",
+                   header->subcache_num, header->index_num);
+        if (non_empty_subcaches) {
+            apr_time_t average_expiry = (apr_time_t)(expiry_total / (double)non_empty_subcaches);
+            ap_rprintf(r, "time left on oldest entries' objects: ");
+            if (now < average_expiry)
+                ap_rprintf(r, "avg: <b>%d</b> seconds, (range: %d...%d)<br>",
+                           (int)apr_time_sec(average_expiry - now),
+                           (int)apr_time_sec(min_expiry - now),
+                           (int)apr_time_sec(max_expiry - now));
+            else
+                ap_rprintf(r, "expiry_threshold: <b>Calculation error!</b><br>");
+        }
+
+        ap_rprintf(r, "index usage: <b>%d%%</b>, cache usage: <b>%d%%</b><br>",
+                   index_pct, cache_pct);
+        ap_rprintf(r, "total entries stored since starting: <b>%lu</b><br>",
+                   header->stat_stores);
+        ap_rprintf(r, "total entries replaced since starting: <b>%lu</b><br>",
+                   header->stat_replaced);
+        ap_rprintf(r, "total entries expired since starting: <b>%lu</b><br>",
+                   header->stat_expiries);
+        ap_rprintf(r, "total (pre-expiry) entries scrolled out of the cache: "
+                   "<b>%lu</b><br>", header->stat_scrolled);
+        ap_rprintf(r, "total retrieves since starting: <b>%lu</b> hit, "
+                   "<b>%lu</b> miss<br>", header->stat_retrieves_hit,
+                   header->stat_retrieves_miss);
+        ap_rprintf(r, "total removes since starting: <b>%lu</b> hit, "
+                   "<b>%lu</b> miss<br>", header->stat_removes_hit,
+                   header->stat_removes_miss);
     }
+    else {
+        ap_rputs("CacheType: SHMCB\n", r);
+        ap_rprintf(r, "CacheSharedMemory: %" APR_SIZE_T_FMT "\n",
+                   ctx->shm_size);
+        ap_rprintf(r, "CacheCurrentEntries: %d\n", total);
+        ap_rprintf(r, "CacheSubcaches: %d\n", header->subcache_num);
+        ap_rprintf(r, "CacheIndexesPerSubcaches: %d\n", header->index_num);
+        if (non_empty_subcaches) {
+            apr_time_t average_expiry = (apr_time_t)(expiry_total / (double)non_empty_subcaches);
+            if (now < average_expiry) {
+                ap_rprintf(r, "CacheTimeLeftOldestAvg: %d\n", (int)apr_time_sec(average_expiry - now));
+                ap_rprintf(r, "CacheTimeLeftOldestMin: %d\n", (int)apr_time_sec(min_expiry - now));
+                ap_rprintf(r, "CacheTimeLeftOldestMax: %d\n", (int)apr_time_sec(max_expiry - now));
+            }
+        }
 
-    ap_rprintf(r, "index usage: <b>%d%%</b>, cache usage: <b>%d%%</b><br>",
-               index_pct, cache_pct);
-    ap_rprintf(r, "total entries stored since starting: <b>%lu</b><br>",
-               header->stat_stores);
-    ap_rprintf(r, "total entries replaced since starting: <b>%lu</b><br>",
-               header->stat_replaced);
-    ap_rprintf(r, "total entries expired since starting: <b>%lu</b><br>",
-               header->stat_expiries);
-    ap_rprintf(r, "total (pre-expiry) entries scrolled out of the cache: "
-               "<b>%lu</b><br>", header->stat_scrolled);
-    ap_rprintf(r, "total retrieves since starting: <b>%lu</b> hit, "
-               "<b>%lu</b> miss<br>", header->stat_retrieves_hit,
-               header->stat_retrieves_miss);
-    ap_rprintf(r, "total removes since starting: <b>%lu</b> hit, "
-               "<b>%lu</b> miss<br>", header->stat_removes_hit,
-               header->stat_removes_miss);
+        ap_rprintf(r, "CacheIndexUsage: %d%%\n", index_pct);
+        ap_rprintf(r, "CacheUsage: %d%%\n", cache_pct);
+        ap_rprintf(r, "CacheStoreCount: %lu\n", header->stat_stores);
+        ap_rprintf(r, "CacheReplaceCount: %lu\n", header->stat_replaced);
+        ap_rprintf(r, "CacheExpireCount: %lu\n", header->stat_expiries);
+        ap_rprintf(r, "CacheDiscardCount: %lu\n", header->stat_scrolled);
+        ap_rprintf(r, "CacheRetrieveHitCount: %lu\n", header->stat_retrieves_hit);
+        ap_rprintf(r, "CacheRetrieveMissCount: %lu\n", header->stat_retrieves_miss);
+        ap_rprintf(r, "CacheRemoveHitCount: %lu\n", header->stat_removes_hit);
+        ap_rprintf(r, "CacheRemoveMissCount: %lu\n", header->stat_removes_miss);
+    }
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00841) "leaving shmcb_status");
 }
 
index 885a2c9eed8d6c1d8c858c90d77fee208399be4e..6fe8517606f8282d6d689e6158fb0b1bf3cb2721 100644 (file)
@@ -2538,77 +2538,103 @@ static int proxy_status_hook(request_rec *r, int flags)
     proxy_balancer *balancer = NULL;
     proxy_worker **worker = NULL;
 
-    if ((flags & AP_STATUS_SHORT) || conf->balancers->nelts == 0 ||
+    if (conf->balancers->nelts == 0 ||
         conf->proxy_status == status_off)
         return OK;
 
     balancer = (proxy_balancer *)conf->balancers->elts;
     for (i = 0; i < conf->balancers->nelts; i++) {
-        ap_rputs("<hr />\n<h1>Proxy LoadBalancer Status for ", r);
-        ap_rvputs(r, balancer->s->name, "</h1>\n\n", NULL);
-        ap_rputs("\n\n<table border=\"0\"><tr>"
-                 "<th>SSes</th><th>Timeout</th><th>Method</th>"
-                 "</tr>\n<tr>", r);
-        if (*balancer->s->sticky) {
-            if (strcmp(balancer->s->sticky, balancer->s->sticky_path)) {
-                ap_rvputs(r, "<td>", balancer->s->sticky, " | ",
-                          balancer->s->sticky_path, NULL);
+        if (!(flags & AP_STATUS_SHORT)) {
+            ap_rputs("<hr />\n<h1>Proxy LoadBalancer Status for ", r);
+            ap_rvputs(r, balancer->s->name, "</h1>\n\n", NULL);
+            ap_rputs("\n\n<table border=\"0\"><tr>"
+                     "<th>SSes</th><th>Timeout</th><th>Method</th>"
+                     "</tr>\n<tr>", r);
+            if (*balancer->s->sticky) {
+                if (strcmp(balancer->s->sticky, balancer->s->sticky_path)) {
+                    ap_rvputs(r, "<td>", balancer->s->sticky, " | ",
+                              balancer->s->sticky_path, NULL);
+                }
+                else {
+                    ap_rvputs(r, "<td>", balancer->s->sticky, NULL);
+                }
             }
             else {
-                ap_rvputs(r, "<td>", balancer->s->sticky, NULL);
+                ap_rputs("<td> - ", r);
             }
+            ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>",
+                       apr_time_sec(balancer->s->timeout));
+            ap_rprintf(r, "<td>%s</td>\n",
+                       balancer->lbmethod->name);
+            ap_rputs("</table>\n", r);
+            ap_rputs("\n\n<table border=\"0\"><tr>"
+                     "<th>Sch</th><th>Host</th><th>Stat</th>"
+                     "<th>Route</th><th>Redir</th>"
+                     "<th>F</th><th>Set</th><th>Acc</th><th>Wr</th><th>Rd</th>"
+                     "</tr>\n", r);
         }
         else {
-            ap_rputs("<td> - ", r);
-        }
-        ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>",
-                   apr_time_sec(balancer->s->timeout));
-        ap_rprintf(r, "<td>%s</td>\n",
-                   balancer->lbmethod->name);
-        ap_rputs("</table>\n", r);
-        ap_rputs("\n\n<table border=\"0\"><tr>"
-                 "<th>Sch</th><th>Host</th><th>Stat</th>"
-                 "<th>Route</th><th>Redir</th>"
-                 "<th>F</th><th>Set</th><th>Acc</th><th>Wr</th><th>Rd</th>"
-                 "</tr>\n", r);
+            ap_rprintf(r, "ProxyBalancer[%d]Name: %s\n", i, balancer->s->name);
+        }
 
         worker = (proxy_worker **)balancer->workers->elts;
         for (n = 0; n < balancer->workers->nelts; n++) {
             char fbuf[50];
-            ap_rvputs(r, "<tr>\n<td>", (*worker)->s->scheme, "</td>", NULL);
-            ap_rvputs(r, "<td>", (*worker)->s->hostname, "</td><td>", NULL);
-            ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, *worker), NULL);
-            ap_rvputs(r, "</td><td>", (*worker)->s->route, NULL);
-            ap_rvputs(r, "</td><td>", (*worker)->s->redirect, NULL);
-            ap_rprintf(r, "</td><td>%d</td>", (*worker)->s->lbfactor);
-            ap_rprintf(r, "<td>%d</td>", (*worker)->s->lbset);
-            ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td><td>", (*worker)->s->elected);
-            ap_rputs(apr_strfsize((*worker)->s->transferred, fbuf), r);
-            ap_rputs("</td><td>", r);
-            ap_rputs(apr_strfsize((*worker)->s->read, fbuf), r);
-            ap_rputs("</td>\n", r);
-
-            /* TODO: Add the rest of dynamic worker data */
-            ap_rputs("</tr>\n", r);
+            if (!(flags & AP_STATUS_SHORT)) {
+                ap_rvputs(r, "<tr>\n<td>", (*worker)->s->scheme, "</td>", NULL);
+                ap_rvputs(r, "<td>", (*worker)->s->hostname, "</td><td>", NULL);
+                ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, *worker), NULL);
+                ap_rvputs(r, "</td><td>", (*worker)->s->route, NULL);
+                ap_rvputs(r, "</td><td>", (*worker)->s->redirect, NULL);
+                ap_rprintf(r, "</td><td>%d</td>", (*worker)->s->lbfactor);
+                ap_rprintf(r, "<td>%d</td>", (*worker)->s->lbset);
+                ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td><td>",
+                           (*worker)->s->elected);
+                ap_rputs(apr_strfsize((*worker)->s->transferred, fbuf), r);
+                ap_rputs("</td><td>", r);
+                ap_rputs(apr_strfsize((*worker)->s->read, fbuf), r);
+                ap_rputs("</td>\n", r);
+
+                /* TODO: Add the rest of dynamic worker data */
+                ap_rputs("</tr>\n", r);
+            }
+            else {
+                ap_rprintf(r, "ProxyBalancer[%d]Worker[%d]Name: %s\n",
+                           i, n, (*worker)->s->name);
+                ap_rprintf(r, "ProxyBalancer[%d]Worker[%d]Status: %s\n",
+                           i, n, ap_proxy_parse_wstatus(r->pool, *worker));
+                ap_rprintf(r, "ProxyBalancer[%d]Worker[%d]Elected: %"
+                              APR_SIZE_T_FMT "\n",
+                           i, n, (*worker)->s->elected);
+                ap_rprintf(r, "ProxyBalancer[%d]Worker[%d]Sent: %s\n",
+                           i, n, apr_strfsize((*worker)->s->transferred, fbuf));
+                ap_rprintf(r, "ProxyBalancer[%d]Worker[%d]Rcvd: %s\n",
+                           i, n, apr_strfsize((*worker)->s->read, fbuf));
+                /* TODO: Add the rest of dynamic worker data */
+            }
 
             ++worker;
         }
-        ap_rputs("</table>\n", r);
+        if (!(flags & AP_STATUS_SHORT)) {
+            ap_rputs("</table>\n", r);
+        }
         ++balancer;
     }
-    ap_rputs("<hr /><table>\n"
-             "<tr><th>SSes</th><td>Sticky session name</td></tr>\n"
-             "<tr><th>Timeout</th><td>Balancer Timeout</td></tr>\n"
-             "<tr><th>Sch</th><td>Connection scheme</td></tr>\n"
-             "<tr><th>Host</th><td>Backend Hostname</td></tr>\n"
-             "<tr><th>Stat</th><td>Worker status</td></tr>\n"
-             "<tr><th>Route</th><td>Session Route</td></tr>\n"
-             "<tr><th>Redir</th><td>Session Route Redirection</td></tr>\n"
-             "<tr><th>F</th><td>Load Balancer Factor</td></tr>\n"
-             "<tr><th>Acc</th><td>Number of uses</td></tr>\n"
-             "<tr><th>Wr</th><td>Number of bytes transferred</td></tr>\n"
-             "<tr><th>Rd</th><td>Number of bytes read</td></tr>\n"
-             "</table>", r);
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rputs("<hr /><table>\n"
+                 "<tr><th>SSes</th><td>Sticky session name</td></tr>\n"
+                 "<tr><th>Timeout</th><td>Balancer Timeout</td></tr>\n"
+                 "<tr><th>Sch</th><td>Connection scheme</td></tr>\n"
+                 "<tr><th>Host</th><td>Backend Hostname</td></tr>\n"
+                 "<tr><th>Stat</th><td>Worker status</td></tr>\n"
+                 "<tr><th>Route</th><td>Session Route</td></tr>\n"
+                 "<tr><th>Redir</th><td>Session Route Redirection</td></tr>\n"
+                 "<tr><th>F</th><td>Load Balancer Factor</td></tr>\n"
+                 "<tr><th>Acc</th><td>Number of uses</td></tr>\n"
+                 "<tr><th>Wr</th><td>Number of bytes transferred</td></tr>\n"
+                 "<tr><th>Rd</th><td>Number of bytes read</td></tr>\n"
+                 "</table>", r);
+    }
 
     return OK;
 }
index 01f72546cdb8830aaec3fe9400f28887b2098bfa..2d365b221506eb674330ef44a651a34ecc64e530 100644 (file)
@@ -198,15 +198,20 @@ static int ssl_ext_status_hook(request_rec *r, int flags)
 {
     SSLModConfigRec *mc = myModConfig(r->server);
 
-    if (mc == NULL || flags & AP_STATUS_SHORT || mc->sesscache == NULL)
+    if (mc == NULL || mc->sesscache == NULL)
         return OK;
 
-    ap_rputs("<hr>\n", r);
-    ap_rputs("<table cellspacing=0 cellpadding=0>\n", r);
-    ap_rputs("<tr><td bgcolor=\"#000000\">\n", r);
-    ap_rputs("<b><font color=\"#ffffff\" face=\"Arial,Helvetica\">SSL/TLS Session Cache Status:</font></b>\r", r);
-    ap_rputs("</td></tr>\n", r);
-    ap_rputs("<tr><td bgcolor=\"#ffffff\">\n", r);
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rputs("<hr>\n", r);
+        ap_rputs("<table cellspacing=0 cellpadding=0>\n", r);
+        ap_rputs("<tr><td bgcolor=\"#000000\">\n", r);
+        ap_rputs("<b><font color=\"#ffffff\" face=\"Arial,Helvetica\">SSL/TLS Session Cache Status:</font></b>\r", r);
+        ap_rputs("</td></tr>\n", r);
+        ap_rputs("<tr><td bgcolor=\"#ffffff\">\n", r);
+    }
+    else {
+        ap_rputs("TLSSessionCacheStatus\n", r);
+    }
 
     if (mc->sesscache->flags & AP_SOCACHE_FLAG_NOTMPSAFE) {
         ssl_mutex_on(r->server);
@@ -218,8 +223,11 @@ static int ssl_ext_status_hook(request_rec *r, int flags)
         ssl_mutex_off(r->server);
     }
 
-    ap_rputs("</td></tr>\n", r);
-    ap_rputs("</table>\n", r);
+    if (!(flags & AP_STATUS_SHORT)) {
+        ap_rputs("</td></tr>\n", r);
+        ap_rputs("</table>\n", r);
+    }
+
     return OK;
 }