From: markt Date: Wed, 22 Jun 2011 23:17:14 +0000 (+0000) Subject: Connector refactoring X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d22272ce6d9f82078ba5a62314f3cfa095ffb0ec;p=tomcat7.0 Connector refactoring Another small step towards SocketWrapper for NIO git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1138678 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/http11/Http11NioProtocol.java b/java/org/apache/coyote/http11/Http11NioProtocol.java index 79dbf8728..092d0f573 100644 --- a/java/org/apache/coyote/http11/Http11NioProtocol.java +++ b/java/org/apache/coyote/http11/Http11NioProtocol.java @@ -30,6 +30,7 @@ import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.NioChannel; import org.apache.tomcat.util.net.NioEndpoint; import org.apache.tomcat.util.net.NioEndpoint.Handler; +import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; import org.apache.tomcat.util.net.SSLImplementation; import org.apache.tomcat.util.net.SecureNioChannel; import org.apache.tomcat.util.net.SocketStatus; @@ -234,8 +235,7 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol { NioChannel socket = socketWrapper.getSocket(); Http11NioProcessor processor = connections.remove(socket); - NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false); - att.setAsync(false); //no longer check for timeout + socketWrapper.setAsync(false); //no longer check for timeout try { if (processor == null) { @@ -277,7 +277,7 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol { connections.put(socket, processor); if (processor.isAsync()) { - att.setAsync(true); + socketWrapper.setAsync(true); } else { // Either: // - this is comet request @@ -286,7 +286,8 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol { SelectionKey key = socket.getIOChannel().keyFor( socket.getPoller().getSelector()); key.interestOps(SelectionKey.OP_READ); - att.interestOps(SelectionKey.OP_READ); + ((KeyAttachment) socketWrapper).interestOps( + SelectionKey.OP_READ); } } else if (state == SocketState.OPEN){ // In keep-alive but between requests. OK to recycle