From 3de2ba33f15edbc0cd49cc24c5e8d8ab218f1b0f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 11 Jun 2013 10:52:15 +1000 Subject: [PATCH] fixed merge --- .../eclipse/jetty/continuation/Servlet3Continuation.java | 2 +- .../main/java/org/eclipse/jetty/server/HttpChannel.java | 2 +- .../java/org/eclipse/jetty/server/HttpChannelState.java | 9 ++++----- .../org/eclipse/jetty/continuation/ContinuationBase.java | 2 -- .../server/session/AbstractProxySerializationTest.java | 4 ---- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java index 3a387de9aec..2abb8412fef 100644 --- a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java +++ b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java @@ -34,7 +34,7 @@ import javax.servlet.ServletResponseWrapper; /* ------------------------------------------------------------ */ /** * This implementation of Continuation is used by {@link ContinuationSupport} - * when it detects that the application has been deployed in a non-jetty Servlet 3 + * when it detects that the application has been deployed in a Servlet 3 * server. */ public class Servlet3Continuation implements Continuation diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index eeaa8ad03e1..03e718c3fe7 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -355,7 +355,7 @@ public class HttpChannel implements HttpParser.RequestHandler, Runnable _transport.completed(); } - LOG.debug("{} handle exit, result {}", this, next); + LOG.debug("{} handle exit, result {}", this, action); return action!=Action.WAIT; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java index 06821a13797..bc8732df967 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java @@ -163,9 +163,7 @@ public class HttpChannelState { synchronized (this) { - return _state+ - (_initial?",initial ":" ")+ - _async; + return String.format("s=%s i=%b a=%s",_state,_initial,_async); } } @@ -343,7 +341,7 @@ public class HttpChannelState synchronized (this) { if (_async!=Async.STARTED && _async!=Async.EXPIRING) - throw new IllegalStateException(this.getStatusString()); + throw new IllegalStateException("AsyncContext#dispath "+this.getStatusString()); _async=Async.DISPATCH; _event.setDispatchTarget(context,path); @@ -552,7 +550,8 @@ public class HttpChannelState { synchronized (this) { - return _async==Async.STARTED; + // Either we are started, or we are still dispatched and async has been completed or dispatched + return _async==Async.STARTED || _async!=null && _state==State.DISPATCHED; } } diff --git a/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java b/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java index 1695d279b98..51e26b1eafb 100644 --- a/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java +++ b/tests/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationBase.java @@ -77,7 +77,6 @@ public abstract class ContinuationBase protected void doSuspendResume() throws Exception { String response=process("suspend=200&resume=0",null); - System.err.println(response); assertContains("RESUMED",response); assertNotContains("history: onTimeout",response); assertContains("history: onComplete",response); @@ -503,7 +502,6 @@ public abstract class ContinuationBase public void onTimeout(Continuation continuation) { ((HttpServletResponse)continuation.getServletResponse()).addHeader("history","onTimeout"); - continuation.resume(); } }; diff --git a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java index e7fe83f1f52..45ed2a38a46 100644 --- a/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java +++ b/tests/test-sessions/test-sessions-common/src/main/java/org/eclipse/jetty/server/session/AbstractProxySerializationTest.java @@ -119,10 +119,6 @@ public abstract class AbstractProxySerializationTest //stop the context to be sure the sesssion will be passivated context.stop(); - //after a stop some of the volatile info is lost, so reinstate it - context.setClassLoader(loader); - context.addServlet("TestServlet", servletMapping); - //restart the context context.start();