Author: markt Date: Sun Mar 21 14:13:40 2010 New Revision: 925769 URL: http://svn.apache.org/viewvc?rev=925769&view=rev Log: Fix a couple of ASync issues that were causing Servlet 3.0 TCK test failures. 1. <quote section="2.3.3.3" page="17"> The complete method can be invoked by the container if the request is dispatched to a servlet that does not support async processing, or the target servlet called by AsyncContext.dispatch does not do a subsequent call to startAsync. In this case, it is the container's responsibility to call complete() as soon as that servlet's service method is exited. </quote> 2. <quote section="2.3.3.3" page ="13"> public boolean isAsyncStarted() - Returns true if async processing has started on this request, and false otherwise. If this request has been dispatched using one of the AsyncContext.dispatch methods since it was put in asynchronous mode, or a call to AsynContext.complete is made, this method returns false. </quote>
Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=925769&r1=925768&r2=925769&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Sun Mar 21 14:13:40 2010 @@ -144,7 +144,9 @@ public class AsyncContextImpl implements throw new RuntimeException(ix); } } - + if (state.get().equals(AsyncState.DISPATCHED)) { + complete(); + } } else { throw new IllegalStateException("Dispatch not allowed. Invalid state:"+state.get()); } @@ -237,7 +239,7 @@ public class AsyncContextImpl implements } public boolean isStarted() { - return (state.get()!=AsyncState.NOT_STARTED); + return (state.get() == AsyncState.STARTED); } public void setStarted(Context context) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org