Author: mturk
Date: Mon Dec 21 12:02:54 2009
New Revision: 892787

URL: http://svn.apache.org/viewvc?rev=892787&view=rev
Log:
Fix #47224 by invalidating endoint cache on address change

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

Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=892787&r1=892786&r2=892787&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp_common.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp_common.c Mon Dec 21 12:02:54 2009
@@ -1066,9 +1066,18 @@
     aw->s->max_packet_size = aw->max_packet_size;
     aw->s->h.sequence = aw->sequence;
     if (aw->s->addr_sequence != aw->addr_sequence) {
+        unsigned int i;
         aw->s->addr_sequence = aw->addr_sequence;
         strncpy(aw->s->host, aw->host, JK_SHM_STR_SIZ);
         aw->s->port = aw->port;
+        for (i = 0; i < aw->ep_cache_sz; i++) {
+            /* Close all connections in the cache */
+            if (aw->ep_cache[i] && IS_VALID_SOCKET(aw->ep_cache[i]->sd)) {
+                int sd = aw->ep_cache[i]->sd;
+                aw->ep_cache[i]->sd = JK_INVALID_SOCKET;
+                jk_shutdown_socket(sd, l);
+            }
+        }
     }
     if (locked == JK_FALSE)
         jk_shm_unlock();

Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=892787&r1=892786&r2=892787&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Mon Dec 21 12:02:54 2009
@@ -44,6 +44,11 @@
   <subsection name="Native">
     <changelog>
       <fix>
+        <bug>47224</bug>: Status: When address gets changed invalidate
+        all opened sockets in the endpoint cache. This will cause new
+        backend connections to get opened using new address. (mturk)
+      </fix>
+      <fix>
         <bug>47222</bug>: Status: Add ping_timeout to the shared memory
         and allow dynamic configuration. (mturk)
       </fix>



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

Reply via email to