tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1137181 - in /tomcat/trunk/java/org/apache: coyote/ajp/AjpAprProtocol.java coyote/http11/Http11AprProtocol.java tomcat/util/net/AprEndpoint.java
Date Sat, 18 Jun 2011 13:03:51 GMT
Author: markt
Date: Sat Jun 18 13:03:50 2011
New Revision: 1137181

URL: http://svn.apache.org/viewvc?rev=1137181&view=rev
Log:
Connector re-factoring
Start to align APR with BIO/NIO

Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.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=1137181&r1=1137180&r2=1137181&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Sat Jun 18 13:03:50 2011
@@ -136,7 +136,8 @@ public class AjpAprProtocol extends Abst
         }
         
         @Override
-        public SocketState process(SocketWrapper<Long> socket) {
+        public SocketState process(SocketWrapper<Long> socket,
+                SocketStatus status) {
             AjpAprProcessor processor = recycledProcessors.poll();
             try {
                 if (processor == null) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1137181&r1=1137180&r2=1137181&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Sat Jun 18 13:03:50
2011
@@ -262,7 +262,8 @@ public class Http11AprProtocol extends A
         }
         
         @Override
-        public SocketState process(SocketWrapper<Long> socket) {
+        public SocketState process(SocketWrapper<Long> socket,
+                SocketStatus status) {
             Http11AprProcessor processor = recycledProcessors.poll();
             try {
                 if (processor == null) {

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1137181&r1=1137180&r2=1137181&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Sat Jun 18 13:03:50 2011
@@ -40,6 +40,7 @@ import org.apache.tomcat.jni.SSLSocket;
 import org.apache.tomcat.jni.Socket;
 import org.apache.tomcat.jni.Status;
 import org.apache.tomcat.util.ExceptionUtils;
+import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 
 
 /**
@@ -1638,7 +1639,8 @@ public class AprEndpoint extends Abstrac
      * thread local fields.
      */
     public interface Handler extends AbstractEndpoint.Handler {
-        public SocketState process(SocketWrapper<Long> socket);
+        public SocketState process(SocketWrapper<Long> socket,
+                SocketStatus status);
         public SocketState event(SocketWrapper<Long> socket,
                 SocketStatus status);
         public SocketState asyncDispatch(SocketWrapper<Long> socket,
@@ -1683,7 +1685,8 @@ public class AprEndpoint extends Abstrac
                         return;
                     }
                     // Process the request from this socket
-                    Handler.SocketState state = handler.process(socket);
+                    Handler.SocketState state = handler.process(socket,
+                            SocketStatus.OPEN);
                     if (state == Handler.SocketState.CLOSED) {
                         // Close socket and pool
                         destroySocket(socket.getSocket().longValue());
@@ -1727,7 +1730,12 @@ public class AprEndpoint extends Abstrac
         public void run() {
             synchronized (socket) {
                 // Process the request from this socket
-                Handler.SocketState state = (status==null)?handler.process(socket):handler.asyncDispatch(socket,
status);
+                SocketState state = SocketState.OPEN;
+                if (status == null) {
+                    state = handler.process(socket,SocketStatus.OPEN);
+                } else {
+                    state = handler.asyncDispatch(socket, status);
+                }
                 if (state == Handler.SocketState.CLOSED) {
                     // Close socket and pool
                     destroySocket(socket.getSocket().longValue());



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


Mime
View raw message