Adjust startAsync().complete() behavior
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 26 Mar 2010 16:21:57 +0000 (16:21 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 26 Mar 2010 16:21:57 +0000 (16:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@927951 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/AsyncContextImpl.java

index 0a40858..5abda6f 100644 (file)
@@ -74,8 +74,10 @@ public class AsyncContextImpl implements AsyncContext {
     public void complete() {
         if (state.get()==AsyncState.COMPLETING) {
             //do nothing
-        } else if (state.compareAndSet(AsyncState.STARTED, AsyncState.COMPLETING) ||
-            state.compareAndSet(AsyncState.DISPATCHED, AsyncState.COMPLETING)) {
+        } else if (state.compareAndSet(AsyncState.STARTED, AsyncState.COMPLETING)) {
+                // TODO SERVLET3 - async
+                doInternalComplete(false);
+        } else if (state.compareAndSet(AsyncState.DISPATCHED, AsyncState.COMPLETING)) {
             // TODO SERVLET3 - async
             AtomicBoolean dispatched = new AtomicBoolean(false);
             request.getCoyoteRequest().action(ActionCode.ACTION_ASYNC_COMPLETE,dispatched);