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

svn commit: r417288 - /tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c

Author: mturk
Date: Mon Jun 26 13:07:54 2006
New Revision: 417288

URL: http://svn.apache.org/viewvc?rev=417288&view=rev
Log:
Properly determine the minimum cache size.

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

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=417288&r1=417287&r2=417288&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Mon Jun 26 13:07:54 2006
@@ -2188,7 +2188,12 @@
         }
         JK_ENTER_CS(&aw->cs, rc);
         if (rc) {
-            unsigned int i, n = 0;
+            unsigned int i, n = 0, cnt = 0;
+            /* Count opended slots */
+            for (i = 0; i < aw->ep_cache_sz; i++) {
+                if (aw->ep_cache[i] && aw->ep_cache[i]->sd >= 0)
+                    cnt++;
+            }
             /* Handle worker cache and recycle timeouts */
             for (i = 0; i < aw->ep_cache_sz; i++) {
                 /* Skip the closed sockets */
@@ -2207,7 +2212,7 @@
                                     i, elapsed, (int)(difftime(time(NULL), rt)));
                     }
                 }
-                if (n > aw->ep_mincache_sz) {
+                if ((cnt - n) < aw->ep_mincache_sz) {
                     if (JK_IS_DEBUG_LEVEL(l)) {
                         jk_log(l, JK_LOG_DEBUG,
                         "reached pool min size %u from %u cache slots",



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


Re: svn commit: r417288 - /tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c

Posted by Rainer Jung <ra...@kippdata.de>.
mturk@apache.org schrieb:
> +                if ((cnt - n) < aw->ep_mincache_sz) {
>   
"<=" (lower or equals) instead of "<"?


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