tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r697534 - in /tomcat/connectors/trunk/jk/native/common: jk_ajp_common.c jk_util.c jk_util.h
Date Sun, 21 Sep 2008 16:19:31 GMT
Author: mturk
Date: Sun Sep 21 09:19:31 2008
New Revision: 697534

URL: http://svn.apache.org/viewvc?rev=697534&view=rev
Log:
Add ping_timeout that is used for connection_keepalive and as default value for connect and
prepost timeouts if boolean values are used for them

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
    tomcat/connectors/trunk/jk/native/common/jk_util.c
    tomcat/connectors/trunk/jk/native/common/jk_util.h

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=697534&r1=697533&r2=697534&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Sun Sep 21 09:19:31 2008
@@ -2476,18 +2476,21 @@
             jk_get_worker_cache_timeout(props, p->name,
                                         AJP_DEF_CACHE_TIMEOUT);
 
+        p->ping_timeout =
+            jk_get_worker_ping_timeout(props, p->name, 0);
+
         p->connect_timeout =
             jk_get_worker_connect_timeout(props, p->name,
-                                          AJP_DEF_CONNECT_TIMEOUT);
+                                          p->ping_timeout);
+
+        p->prepost_timeout =
+            jk_get_worker_prepost_timeout(props, p->name,
+                                          p->ping_timeout);
 
         p->reply_timeout =
             jk_get_worker_reply_timeout(props, p->name,
                                         AJP_DEF_REPLY_TIMEOUT);
 
-        p->prepost_timeout =
-            jk_get_worker_prepost_timeout(props, p->name,
-                                          AJP_DEF_PREPOST_TIMEOUT);
-
         p->connection_keepalive =
             jk_get_worker_connection_keepalive(props, p->name, 0);
 
@@ -2543,6 +2546,10 @@
                    p->cache_timeout);
 
             jk_log(l, JK_LOG_DEBUG,
+                   "ping timeout:     %d",
+                   p->ping_timeout);
+
+            jk_log(l, JK_LOG_DEBUG,
                    "connect timeout:  %d",
                    p->connect_timeout);
 
@@ -2880,7 +2887,7 @@
                 }
             }
             /* Handle worker connection keepalive */
-            if (aw->connection_keepalive > 0 && aw->prepost_timeout >
0) {
+            if (aw->connection_keepalive > 0 && aw->ping_timeout > 0)
{
                 for (i = (int)aw->ep_cache_sz - 1; i >= 0; i--) {
                     /* Skip the closed sockets */
                     if (aw->ep_cache[i] && IS_VALID_SOCKET(aw->ep_cache[i]->sd))
{
@@ -2890,7 +2897,7 @@
                             /* handle cping/cpong.
                              */
                             if (ajp_handle_cping_cpong(aw->ep_cache[i],
-                                aw->prepost_timeout, l) == JK_FALSE) {
+                                aw->ping_timeout, l) == JK_FALSE) {
                                 jk_log(l, JK_LOG_INFO,
                                        "(%s) failed sending request, "
                                        "socket %d keepalive cping/cpong "

Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=697534&r1=697533&r2=697534&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Sun Sep 21 09:19:31 2008
@@ -57,6 +57,7 @@
 #define PREPOST_TIMEOUT_OF_WORKER   ("prepost_timeout")
 #define REPLY_TIMEOUT_OF_WORKER     ("reply_timeout")
 #define SOCKET_TIMEOUT_OF_WORKER    ("socket_timeout")
+#define PING_TIMEOUT_OF_WORKER      ("ping_timeout")
 #define SOCKET_BUFFER_OF_WORKER     ("socket_buffer")
 #define SOCKET_KEEPALIVE_OF_WORKER  ("socket_keepalive")
 #define CONNECTION_KEEPALIVE_OF_WORKER  ("connection_keepalive")
@@ -170,6 +171,7 @@
     RECOVERY_OPTS_OF_WORKER,
     CONNECT_TIMEOUT_OF_WORKER,
     PREPOST_TIMEOUT_OF_WORKER,
+    PING_TIMEOUT_OF_WORKER,
     REPLY_TIMEOUT_OF_WORKER,
     SOCKET_TIMEOUT_OF_WORKER,
     SOCKET_BUFFER_OF_WORKER,
@@ -254,6 +256,7 @@
     RECOVERY_OPTS_OF_WORKER,
     CONNECT_TIMEOUT_OF_WORKER,
     PREPOST_TIMEOUT_OF_WORKER,
+    PING_TIMEOUT_OF_WORKER,
     REPLY_TIMEOUT_OF_WORKER,
     SOCKET_TIMEOUT_OF_WORKER,
     SOCKET_BUFFER_OF_WORKER,
@@ -983,19 +986,23 @@
 int jk_get_worker_connect_timeout(jk_map_t *m, const char *wname, int def)
 {
     char buf[1024];
+    int rv;
 
     if (!m || !wname) {
         return -1;
     }
 
     MAKE_WORKER_PARAM(CONNECT_TIMEOUT_OF_WORKER);
-
-    return jk_map_get_int(m, buf, def);
+    if ((rv = jk_map_get_bool(m, buf, -1)) == -1)
+        return jk_map_get_int(m, buf, AJP_DEF_CONNECT_TIMEOUT);
+    else
+        return def;
 }
 
 int jk_get_worker_prepost_timeout(jk_map_t *m, const char *wname, int def)
 {
     char buf[1024];
+    int rv;
 
     if (!m || !wname) {
         return -1;
@@ -1003,6 +1010,22 @@
 
     MAKE_WORKER_PARAM(PREPOST_TIMEOUT_OF_WORKER);
 
+    if ((rv = jk_map_get_bool(m, buf, -1)) == -1)
+        return jk_map_get_int(m, buf, AJP_DEF_PREPOST_TIMEOUT);
+    else
+        return def;
+}
+
+int jk_get_worker_ping_timeout(jk_map_t *m, const char *wname, int def)
+{
+    char buf[1024];
+
+    if (!m || !wname) {
+        return -1;
+    }
+
+    MAKE_WORKER_PARAM(PING_TIMEOUT_OF_WORKER);
+
     return jk_map_get_int(m, buf, def);
 }
 

Modified: tomcat/connectors/trunk/jk/native/common/jk_util.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.h?rev=697534&r1=697533&r2=697534&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.h Sun Sep 21 09:19:31 2008
@@ -86,6 +86,8 @@
 
 int jk_get_worker_prepost_timeout(jk_map_t *m, const char *wname, int def);
 
+int jk_get_worker_ping_timeout(jk_map_t *m, const char *wname, int def);
+
 int jk_get_worker_recycle_timeout(jk_map_t *m, const char *wname, int def);
 
 int jk_get_worker_recover_timeout(jk_map_t *m, const char *wname, int def);



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


Mime
View raw message