From: markt Date: Sun, 26 Sep 2010 22:22:25 +0000 (+0000) Subject: Better Javadoc. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=abc3d0aa4c638571978003573b040c4cf2af95eb;p=tomcat7.0 Better Javadoc. If endpoint is shutting down, return false so connection to client is closed immediately. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1001538 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/JIoEndpoint.java b/java/org/apache/tomcat/util/net/JIoEndpoint.java index a24059294..c8bc4e274 100644 --- a/java/org/apache/tomcat/util/net/JIoEndpoint.java +++ b/java/org/apache/tomcat/util/net/JIoEndpoint.java @@ -490,7 +490,17 @@ public class JIoEndpoint extends AbstractEndpoint { /** - * Process given socket. + * Process a new connection from a new client. Wraps the socket so + * keep-alive and other attributes can be tracked and then passes the socket + * to the executor for processing. + * + * @param socket The socket associated with the client. + * + * @return true if the socket is passed to the + * executor, false if something went wrong or + * if the endpoint is shutting down. Returning + * false is an indication to close the socket + * immediately. */ protected boolean processSocket(Socket socket) { // Process the request from this socket @@ -500,7 +510,9 @@ public class JIoEndpoint extends AbstractEndpoint { // During shutdown, executor may be null - avoid NPE if (running) { getExecutor().execute(new SocketProcessor(wrapper)); + return true; } + return false; } catch (RejectedExecutionException x) { log.warn("Socket processing request was rejected for:"+socket,x); return false; @@ -510,7 +522,6 @@ public class JIoEndpoint extends AbstractEndpoint { log.error(sm.getString("endpoint.process.fail"), t); return false; } - return true; } public boolean processSocket(SocketWrapper socket, SocketStatus status) {