tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1137047 - /tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
Date Fri, 17 Jun 2011 21:56:58 GMT
Author: markt
Date: Fri Jun 17 21:56:58 2011
New Revision: 1137047

URL: http://svn.apache.org/viewvc?rev=1137047&view=rev
Log:
Connector re-factoring
First step towards removing SocketState.ASYNC_END from the endpoint
Also a few percent faster, at least running the Async unit tests

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1137047&r1=1137046&r2=1137047&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Fri Jun 17 21:56:58 2011
@@ -154,19 +154,22 @@ public class Http11Protocol extends Abst
                     processor.setSSLSupport(null);
                 }
                 
-                SocketState state;
-                if (socket.isAsync()) {
-                    state = processor.asyncDispatch(status);
-                } else {
-                    state = processor.process(socket);
-                }
-
-                if (processor.isAsync()) {
-                    state = processor.asyncPostProcess();
-                }
+                SocketState state = SocketState.CLOSED;
+                do {
+                    if (socket.isAsync() || state == SocketState.ASYNC_END) {
+                        state = processor.asyncDispatch(status);
+                    } else {
+                        state = processor.process(socket);
+                    }
+    
+                    if (processor.isAsync()) {
+                        state = processor.asyncPostProcess();
+                    }
+                } while (state == SocketState.ASYNC_END);
+                // TODO Better to add a new state to the AsyncStateMachine and
+                //      remove ASYNC_END entirely
 
-                if (state == SocketState.LONG ||
-                        state == SocketState.ASYNC_END) {
+                if (state == SocketState.LONG) {
                     connections.put(socket, processor);
                     socket.setAsync(true);
                 } else {



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


Mime
View raw message