You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2006/06/06 11:29:54 UTC

svn commit: r412057 - /tomcat/connectors/trunk/jk/native/common/jk_status.c

Author: rjung
Date: Tue Jun  6 02:29:53 2006
New Revision: 412057

URL: http://svn.apache.org/viewvc?rev=412057&view=rev
Log:
Add refresh request parameter to status worker.
Functionality is equivalent to apache server-status:
refresh=n refreshes the page every n seconds.
Only useful for cmd=list.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_status.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_status.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_status.c?rev=412057&r1=412056&r2=412057&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Tue Jun  6 02:29:53 2006
@@ -289,8 +289,15 @@
     *buf = '\0';
     if (!req)
         return NULL;
+    if (!param)
+        return NULL;
     sprintf(ps, "&%s=", param);
     p = strstr(req, ps);
+    if (!p) {
+        sprintf(ps, "%s=", param);
+        if (!strncmp(req, ps, strlen(ps)))
+            p = (char *)req;
+    }
     if (p) {
         p += strlen(ps);
         while (*p) {
@@ -885,8 +892,13 @@
             jk_shm_unlock();
         }
         if (mime == 0) {
+            int refresh = status_int("refresh", s->query_string, -1);
             s->start_response(s, 200, "OK", headers_names, headers_vhtml, 3);
             s->write(s, JK_STATUS_HEAD, sizeof(JK_STATUS_HEAD) - 1);
+            if (refresh >= 0) {
+                jk_printf(s, "\n<meta http-equiv=\"Refresh\" content=\"%d;url=%s?refresh=%d\">",
+                          refresh, s->req_uri, refresh);
+            }
             if (p->s_worker->css) {
                 jk_putv(s, "\n<link rel=\"stylesheet\" type=\"text/css\" href=\"",
                         p->s_worker->css, "\" />\n", NULL);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org