Add some Javadoc.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 26 Sep 2010 22:37:31 +0000 (22:37 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 26 Sep 2010 22:37:31 +0000 (22:37 +0000)
Use SocketStatus.OPEN rather than STOP since the BIO connector treats them the same way and it reduces code complexity. It also simplifies async re-factoring I have in the works,

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1001545 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AjpProcessor.java
java/org/apache/coyote/http11/Http11Processor.java
java/org/apache/tomcat/util/net/JIoEndpoint.java

index f6097c0..02ec3ee 100644 (file)
@@ -660,7 +660,7 @@ public class AjpProcessor implements ActionHook {
             RequestInfo rp = request.getRequestProcessor();
             if ( rp.getStage() != org.apache.coyote.Constants.STAGE_SERVICE ) { //async handling
                 dispatch.set(true);
-                endpoint.processSocket(this.socket, SocketStatus.STOP);
+                endpoint.processSocket(this.socket, SocketStatus.OPEN);
             } else {
                 dispatch.set(false);
             }
index 5b056ac..1a88f84 100644 (file)
@@ -502,7 +502,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
             RequestInfo rp = request.getRequestProcessor();
             if ( rp.getStage() != org.apache.coyote.Constants.STAGE_SERVICE ) { //async handling
                 dispatch.set(true);
-                endpoint.processSocket(this.socket, SocketStatus.STOP);
+                endpoint.processSocket(this.socket, SocketStatus.OPEN);
             } else {
                 dispatch.set(false);
             }
index c8bc4e2..0b9cc9f 100644 (file)
@@ -524,9 +524,23 @@ public class JIoEndpoint extends AbstractEndpoint {
         }
     }
     
+    
+    /**
+     * Process an existing async connection. If processing is required, passes
+     * the wrapped socket to an executor for processing.
+     * 
+     * @param socket    The socket associated with the client.
+     * @param status    Only OPEN and TIMEOUT are used. The others are used for
+     *                  Comet requests that are not supported by the BIO (JIO)
+     *                  Connector.
+     * @return          <code>true</code> if the socket is passed to the
+     *                  executor, <code>false</code> if something went wrong.
+     *                  Returning <code>false</code> is an indication to close
+     *                  the socket immediately.
+     */
     public boolean processSocket(SocketWrapper<Socket> socket, SocketStatus status) {
         try {
-            if (status == SocketStatus.OPEN || status == SocketStatus.STOP || status == SocketStatus.TIMEOUT) {
+            if (status == SocketStatus.OPEN || status == SocketStatus.TIMEOUT) {
                 if (waitingRequests.remove(socket)) {
                     SocketProcessor proc = new SocketProcessor(socket,status);
                     ClassLoader loader = Thread.currentThread().getContextClassLoader();