tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1144271 - in /tomcat/trunk/java/org/apache: coyote/ajp/AjpAprProtocol.java coyote/ajp/AjpNioProtocol.java coyote/ajp/AjpProtocol.java tomcat/util/net/AbstractEndpoint.java
Date Fri, 08 Jul 2011 11:40:36 GMT
Author: markt
Date: Fri Jul  8 11:40:36 2011
New Revision: 1144271

URL: http://svn.apache.org/viewvc?rev=1144271&view=rev
Log:
Align the process methods some more.

Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1144271&r1=1144270&r2=1144271&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Fri Jul  8 11:40:36 2011
@@ -174,7 +174,6 @@ public class AjpAprProtocol extends Abst
                     recycledProcessors.offer(processor);
                 }
                 return state;
-
             } catch(java.net.SocketException e) {
                 // SocketExceptions are normal
                 log.debug(sm.getString(

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1144271&r1=1144270&r2=1144271&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Fri Jul  8 11:40:36 2011
@@ -206,7 +206,6 @@ public class AjpNioProtocol extends Abst
                     // In the middle of processing a request/response. Keep the
                     // socket associated with the processor.
                     connections.put(socket, processor);
-                    
                     socket.setAsync(true);
                 } else if (state == SocketState.OPEN){
                     // In keep-alive but between requests. OK to recycle
@@ -218,7 +217,6 @@ public class AjpNioProtocol extends Abst
                     release(socket, processor, true);
                 }
                 return state;
-
             } catch(java.net.SocketException e) {
                 // SocketExceptions are normal
                 log.debug(sm.getString(

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java?rev=1144271&r1=1144270&r2=1144271&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java Fri Jul  8 11:40:36 2011
@@ -125,8 +125,12 @@ public class AjpProtocol extends Abstrac
         }
         
         @Override
-        public SocketState process(SocketWrapper<Socket> socket, SocketStatus status)
{
+        public SocketState process(SocketWrapper<Socket> socket,
+                SocketStatus status) {
             AjpProcessor processor = connections.remove(socket);
+
+            socket.setAsync(false);
+
             try {
                 if (processor == null) {
                     processor = recycledProcessors.poll();
@@ -147,12 +151,15 @@ public class AjpProtocol extends Abstrac
                         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) {
+                    // In the middle of processing a request/response. Keep the
+                    // socket associated with the processor.
                     connections.put(socket, processor);
+                    socket.setAsync(true);
                 } else if (state == SocketState.OPEN){
+                    // In keep-alive but between requests. OK to recycle
+                    // processor. Continue to poll for the next request.
                     processor.recycle(false);
                     recycledProcessors.offer(processor);
                 } else {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1144271&r1=1144270&r2=1144271&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Fri Jul  8 11:40:36
2011
@@ -52,6 +52,8 @@ public abstract class AbstractEndpoint {
          * Different types of socket states to react upon.
          */
         public enum SocketState {
+            // TODO Add a new state to the AsyncStateMachine and remove
+            //      ASYNC_END (if possible)
             OPEN, CLOSED, LONG, ASYNC_END
         }
         



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


Mime
View raw message