changeset 928:23a57aad34c0

remove isAsync()
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 09 Oct 2016 18:54:32 -0600
parents 1c1c350fbe4b
children 3191abe890ef
files src/org/eclipse/jetty/server/AbstractHttpConnection.java src/org/eclipse/jetty/server/AsyncContinuation.java src/org/eclipse/jetty/server/AsyncHttpConnection.java src/org/eclipse/jetty/server/handler/RequestLogHandler.java
diffstat 4 files changed, 13 insertions(+), 62 deletions(-) [+]
line wrap: on
line diff
diff -r 1c1c350fbe4b -r 23a57aad34c0 src/org/eclipse/jetty/server/AbstractHttpConnection.java
--- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Sun Oct 09 18:34:24 2016 -0600
+++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Sun Oct 09 18:54:32 2016 -0600
@@ -416,8 +416,8 @@
 			// within the call to unhandle().
 
 			final Server server=_server;
-			boolean handling=_request._async.handling() && server!=null && server.isRunning();
-			while (handling)
+			boolean handling = _request._async.handling() && server!=null && server.isRunning();
+			if(handling)
 			{
 				_request.setHandled(false);
 
@@ -504,7 +504,7 @@
 				}
 				finally
 				{
-					handling = !_request._async.unhandle() && server.isRunning() && _server!=null;
+					_request._async.unhandle();
 				}
 			}
 		}
diff -r 1c1c350fbe4b -r 23a57aad34c0 src/org/eclipse/jetty/server/AsyncContinuation.java
--- a/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 18:34:24 2016 -0600
+++ b/src/org/eclipse/jetty/server/AsyncContinuation.java	Sun Oct 09 18:54:32 2016 -0600
@@ -288,22 +288,16 @@
 	 * @return true if handling is complete, false if the request should 
 	 * be handled again (eg because of a resume that happened before unhandle was called)
 	 */
-	protected boolean unhandle()
+	protected synchronized void unhandle()
 	{
-		synchronized (this)
+		switch(_state)
 		{
-			switch(_state)
-			{
-				case __DISPATCHED:
-					_state = __UNCOMPLETED;
-					return true;
+			case __DISPATCHED:
+				_state = __UNCOMPLETED;
+				return;
 
-				case __IDLE:
-					throw new IllegalStateException(this.getStatusString());
-
-				default:
-					throw new IllegalStateException(this.getStatusString());
-			}
+			default:
+				throw new IllegalStateException(this.getStatusString());
 		}
 	}
 
@@ -500,25 +494,6 @@
 		}
 	}
 
-
-	public boolean isAsync()
-	{
-		synchronized (this)
-		{
-			switch(_state)
-			{
-				case __IDLE:
-				case __DISPATCHED:
-				case __UNCOMPLETED:
-				case __COMPLETED:
-					return false;
-
-				default:
-					return true;
-			}
-		}
-	}
-
 	/* ------------------------------------------------------------ */
 	public void dispatch(ServletContext context, String path)
 	{
diff -r 1c1c350fbe4b -r 23a57aad34c0 src/org/eclipse/jetty/server/AsyncHttpConnection.java
--- a/src/org/eclipse/jetty/server/AsyncHttpConnection.java	Sun Oct 09 18:34:24 2016 -0600
+++ b/src/org/eclipse/jetty/server/AsyncHttpConnection.java	Sun Oct 09 18:54:32 2016 -0600
@@ -72,14 +72,8 @@
                 progress=false;
                 try
                 {
-                    // Handle resumed request
-                    if (_request._async.isAsync())
-                    {
-                       if (_request._async.isDispatchable())
-                           handleRequest();
-                    }
-                    // else Parse more input
-                    else if (!_parser.isComplete() && _parser.parseAvailable())
+                    // Parse more input
+                    if (!_parser.isComplete() && _parser.parseAvailable())
                         progress=true;
 
                     // Generate more output
diff -r 1c1c350fbe4b -r 23a57aad34c0 src/org/eclipse/jetty/server/handler/RequestLogHandler.java
--- a/src/org/eclipse/jetty/server/handler/RequestLogHandler.java	Sun Oct 09 18:34:24 2016 -0600
+++ b/src/org/eclipse/jetty/server/handler/RequestLogHandler.java	Sun Oct 09 18:54:32 2016 -0600
@@ -79,25 +79,7 @@
 		{
 			if (baseRequest.getDispatcherType().equals(DispatcherType.REQUEST))
 			{
-				if (continuation.isAsync())
-				{
-					if (continuation.isInitial())
-						continuation.addContinuationListener(new ContinuationListener()
-						{
-
-							public void onTimeout(Continuation continuation)
-							{
-
-							}
-
-							public void onComplete(Continuation continuation)
-							{
-								log(baseRequest, (Response)response);
-							}
-						});
-				}
-				else
-					log(baseRequest, (Response)response);
+				log(baseRequest, (Response)response);
 			}
 		}
 	}