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 2007/11/30 09:52:20 UTC

svn commit: r599743 - in /tomcat/connectors/trunk/jk: native/common/jk_ajp_common.c xdocs/miscellaneous/changelog.xml

Author: rjung
Date: Fri Nov 30 00:52:17 2007
New Revision: 599743

URL: http://svn.apache.org/viewvc?rev=599743&view=rev
Log:
Maintain idle connections in decreasing (LRU) slot order.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml

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=599743&r1=599742&r2=599743&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Fri Nov 30 00:52:17 2007
@@ -2609,7 +2609,7 @@
         if (rc) {
             unsigned int i, n = 0, cnt = 0;
             /* Count open slots */
-            for (i = 0; i < aw->ep_cache_sz; i++) {
+            for (i = aw->ep_cache_sz - 1; i >= 0; i--) {
                 if (aw->ep_cache[i] && IS_VALID_SOCKET(aw->ep_cache[i]->sd))
                     cnt++;
             }

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=599743&r1=599742&r2=599743&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Fri Nov 30 00:52:17 2007
@@ -44,6 +44,10 @@
   <subsection name="Native">
     <changelog>
       <update>
+        Common: Maintain idle connections in decreasing (LRU)
+        slot order. (rjung)
+      </update>
+      <update>
         Apache: Create JK_WORKER_ROUTE and JK_REQUEST_DURATION notes for
         access log even if no JkRequestLogFormat is set. (rjung)
       </update>



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


Re: svn commit: r599743 - in /tomcat/connectors/trunk/jk: native/common/jk_ajp_common.c xdocs/miscellaneous/changelog.xml

Posted by Mladen Turk <mt...@apache.org>.
rjung@apache.org wrote:
> Author: rjung
> Date: Fri Nov 30 00:52:17 2007
> New Revision: 599743
> 
> URL: http://svn.apache.org/viewvc?rev=599743&view=rev
> Log:
> Maintain idle connections in decreasing (LRU) slot order.
> 
> Modified:
>     tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
>     tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
> 
> 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=599743&r1=599742&r2=599743&view=diff
> ==============================================================================
> --- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
> +++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Fri Nov 30 00:52:17 2007
> @@ -2609,7 +2609,7 @@
>          if (rc) {
>              unsigned int i, n = 0, cnt = 0;
>              /* Count open slots */
> -            for (i = 0; i < aw->ep_cache_sz; i++) {
> +            for (i = aw->ep_cache_sz - 1; i >= 0; i--) {

i is unsigned, so this is not very smart thing to do.
perhaps a:

<snip>
int i;
unsigned int n = 0, cnt=0;
...
for (i = (int)aw->ep_cache_sz - 1; i >= 0; i--) {
</snip>

Regards,
Mladen

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