From 00e1df247ba218446629c514dc7477785bcf52a8 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 26 Sep 2010 22:37:31 +0000 Subject: [PATCH] Add some Javadoc. 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 | 2 +- java/org/apache/coyote/http11/Http11Processor.java | 2 +- java/org/apache/tomcat/util/net/JIoEndpoint.java | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index f6097c000..02ec3ee2c 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -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); } diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index 5b056ac3f..1a88f8414 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -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); } diff --git a/java/org/apache/tomcat/util/net/JIoEndpoint.java b/java/org/apache/tomcat/util/net/JIoEndpoint.java index c8bc4e274..0b9cc9fb7 100644 --- a/java/org/apache/tomcat/util/net/JIoEndpoint.java +++ b/java/org/apache/tomcat/util/net/JIoEndpoint.java @@ -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 true if the socket is passed to the + * executor, false if something went wrong. + * Returning false is an indication to close + * the socket immediately. + */ public boolean processSocket(SocketWrapper 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(); -- 2.11.0