From: markt Date: Wed, 22 Jun 2011 23:40:30 +0000 (+0000) Subject: Connector refactoring X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=059f57e8c8d6f168c57c212ce368feff94a4ce81;p=tomcat7.0 Connector refactoring SocketWrapper changes for AJP processor git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1138694 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/ajp/AjpNioProcessor.java b/java/org/apache/coyote/ajp/AjpNioProcessor.java index 39b164cbe..555945f08 100644 --- a/java/org/apache/coyote/ajp/AjpNioProcessor.java +++ b/java/org/apache/coyote/ajp/AjpNioProcessor.java @@ -39,6 +39,7 @@ import org.apache.tomcat.util.net.NioEndpoint; import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; import org.apache.tomcat.util.net.NioSelectorPool; import org.apache.tomcat.util.net.SocketStatus; +import org.apache.tomcat.util.net.SocketWrapper; /** @@ -100,13 +101,13 @@ public class AjpNioProcessor extends AbstractAjpProcessor { * * @throws IOException error during an I/O operation */ - public SocketState process(NioChannel socket) + public SocketState process(SocketWrapper socket) throws IOException { RequestInfo rp = request.getRequestProcessor(); rp.setStage(org.apache.coyote.Constants.STAGE_PARSE); // Setting up the socket - this.socket = socket; + this.socket = socket.getSocket(); long soTimeout = endpoint.getSoTimeout(); int keepAliveTimeout = endpoint.getKeepAliveTimeout(); @@ -114,8 +115,6 @@ public class AjpNioProcessor extends AbstractAjpProcessor { // Error flag error = false; - final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false); - while (!error && !endpoint.isPaused()) { // Parsing the request header try { @@ -127,7 +126,7 @@ public class AjpNioProcessor extends AbstractAjpProcessor { } // Set back timeout if keep alive timeout is enabled if (keepAliveTimeout > 0) { - ka.setTimeout(soTimeout); + socket.setTimeout(soTimeout); } // Check message type, process right away and break if // not regular request processing @@ -224,7 +223,7 @@ public class AjpNioProcessor extends AbstractAjpProcessor { rp.setStage(org.apache.coyote.Constants.STAGE_KEEPALIVE); // Set keep alive timeout if enabled if (keepAliveTimeout > 0) { - ka.setTimeout(keepAliveTimeout); + socket.setTimeout(keepAliveTimeout); } recycle(); diff --git a/java/org/apache/coyote/ajp/AjpNioProtocol.java b/java/org/apache/coyote/ajp/AjpNioProtocol.java index bbdad555a..c889568a2 100644 --- a/java/org/apache/coyote/ajp/AjpNioProtocol.java +++ b/java/org/apache/coyote/ajp/AjpNioProtocol.java @@ -187,7 +187,7 @@ public class AjpNioProtocol extends AbstractAjpProtocol { if (processor.isAsync() || state == SocketState.ASYNC_END) { state = processor.asyncDispatch(status); } else { - state = processor.process(socket.getSocket()); + state = processor.process(socket); } if (processor.isAsync()) {