Author: markt
Date: Tue Mar 15 20:49:44 2011
New Revision: 1081940

URL: http://svn.apache.org/viewvc?rev=1081940&view=rev
Log:
Handle the scenario where the client sends multiple JSESSIONID cookies. This 
patch trades a little duplication for simpler code. The duplication only occurs 
when the client sends multiple cookies and the request is to a context that 
currently has multiple versions.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1081940&r1=1081939&r2=1081940&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Tue Mar 15 
20:49:44 2011
@@ -2309,7 +2309,23 @@ public class Request
         }
         
         if ((session == null) || !session.isValid()) {
-            return false;
+            // Check for parallel deployment contexts
+            if (getMappingData().contexts == null) {
+                return false;
+            } else {
+                for (int i = (getMappingData().contexts.length); i > 0; i--) {
+                    Context ctxt = (Context) getMappingData().contexts[i - 1];
+                    try {
+                        if (ctxt.getManager().findSession(requestedSessionId) 
!=
+                                null) {
+                            return true;
+                        }
+                    } catch (IOException e) {
+                        // Ignore
+                    }
+                }
+                return false;
+            }
         }
 
         return true;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1081940&r1=1081939&r2=1081940&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Mar 15 20:49:44 2011
@@ -69,6 +69,10 @@
         Remove unnecessary whitespace from MIME mapping entries in global
         web.xml file. (markt)
       </fix>
+      <fix>
+        When using parallel deployment, correctly handle the scenario when the
+        client sends multiple JSESSIONID cookies. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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

Reply via email to