tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r796284 - /tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java
Date Tue, 21 Jul 2009 13:11:05 GMT
Author: fhanik
Date: Tue Jul 21 13:11:04 2009
New Revision: 796284

URL: http://svn.apache.org/viewvc?rev=796284&view=rev
Log:
We can call dispatch after we dispatched. 

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java?rev=796284&r1=796283&r2=796284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java Tue Jul 21 13:11:04
2009
@@ -80,7 +80,9 @@
 
     public void dispatch(ServletContext context, String path) {
         // TODO SERVLET3 - async
-        if (this.state.compareAndSet(AsyncState.STARTED, AsyncState.DISPATCHING)) {
+        if (state.compareAndSet(AsyncState.STARTED, AsyncState.DISPATCHING) ||
+            state.compareAndSet(AsyncState.DISPATCHED, AsyncState.DISPATCHING)) {
+
             if (request.getAttribute(ASYNC_REQUEST_URI)==null) {
                 request.setAttribute(ASYNC_REQUEST_URI, request.getRequestURI());
                 request.setAttribute(ASYNC_CONTEXT_PATH, request.getContextPath());
@@ -159,7 +161,7 @@
         if (state.compareAndSet(AsyncState.NOT_STARTED, AsyncState.STARTED)) {
             this.context = context;
         } else {
-            throw new IllegalStateException("Already started.");
+            throw new IllegalStateException("Start illegal. Invalid state: "+state.get());
         }
     }
 



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


Mime
View raw message