From: markt Date: Sat, 18 Sep 2010 11:53:19 +0000 (+0000) Subject: Code clean-up X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=612170aa54527fd88e189f945e71501ff1dd83f6;p=tomcat7.0 Code clean-up Align end-point behaviours. Should then be easier to apply async chnages. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@998446 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 8371449f8..2200c9da8 100644 --- a/java/org/apache/tomcat/util/net/JIoEndpoint.java +++ b/java/org/apache/tomcat/util/net/JIoEndpoint.java @@ -180,8 +180,11 @@ public class JIoEndpoint extends AbstractEndpoint { } } - // Accept the next incoming connection from the server socket + if (!running) { + break; + } try { + // Accept the next incoming connection from the server socket Socket socket = serverSocketFactory.acceptSocket(serverSocket); serverSocketFactory.initSocket(socket); // Hand this socket off to an appropriate processor diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 5d6d62890..2f2c9a14e 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -761,8 +761,10 @@ public class NioEndpoint extends AbstractEndpoint { */ @Override public void run() { + // Loop until we receive a shutdown command while (running) { + // Loop if endpoint is paused while (paused && running) { try { @@ -771,6 +773,10 @@ public class NioEndpoint extends AbstractEndpoint { // Ignore } } + + if (!running) { + break; + } try { // Accept the next incoming connection from the server socket SocketChannel socket = serverSock.accept();