You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/08/08 23:09:38 UTC

svn commit: r1512034 - in /tomcat/trunk/java/org/apache/coyote: ./ ajp/ http11/

Author: markt
Date: Thu Aug  8 21:09:38 2013
New Revision: 1512034

URL: http://svn.apache.org/r1512034
Log:
Pull up SocketWrapper

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProcessor.java Thu Aug  8 21:09:38 2013
@@ -37,6 +37,7 @@ public abstract class AbstractProcessor<
     protected final AbstractEndpoint endpoint;
     protected final Request request;
     protected final Response response;
+    protected SocketWrapper<S> socketWrapper = null;
 
 
     /**
@@ -100,6 +101,22 @@ public abstract class AbstractProcessor<
 
 
     /**
+     * Set the socket wrapper being used.
+     */
+    protected final void setSocketWrapper(SocketWrapper<S> socketWrapper) {
+        this.socketWrapper = socketWrapper;
+    }
+
+
+    /**
+     * Get the socket wrapper being used.
+     */
+    protected final SocketWrapper<S> getSocketWrapper() {
+        return socketWrapper;
+    }
+
+
+    /**
      * Obtain the Executor used by the underlying endpoint.
      */
     @Override

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Thu Aug  8 21:09:38 2013
@@ -74,13 +74,6 @@ public class AjpAprProcessor extends Abs
 
     // ----------------------------------------------------- Instance Variables
 
-
-    /**
-     * Socket associated with the current connection.
-     */
-    protected SocketWrapper<Long> socket;
-
-
     /**
      * Direct buffer used for input.
      */
@@ -109,7 +102,7 @@ public class AjpAprProcessor extends Abs
         rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
 
         // Setting up the socket
-        this.socket = socket;
+        this.socketWrapper = socket;
         long socketRef = socket.getSocket().longValue();
         Socket.setrbb(socketRef, inputBuffer);
         Socket.setsbb(socketRef, outputBuffer);
@@ -260,16 +253,16 @@ public class AjpAprProcessor extends Abs
 
         if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
-                ((AprEndpoint)endpoint).processSocketAsync(this.socket,
+                ((AprEndpoint)endpoint).processSocketAsync(this.socketWrapper,
                         SocketStatus.OPEN_READ);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param == null) return;
             long timeout = ((Long)param).longValue();
-            socket.setTimeout(timeout);
+            socketWrapper.setTimeout(timeout);
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
-                ((AprEndpoint)endpoint).processSocketAsync(this.socket,
+                ((AprEndpoint)endpoint).processSocketAsync(this.socketWrapper,
                         SocketStatus.OPEN_READ);
             }
         }
@@ -284,7 +277,7 @@ public class AjpAprProcessor extends Abs
             throws IOException {
         outputBuffer.put(src, offset, length);
 
-        long socketRef = socket.getSocket().longValue();
+        long socketRef = socketWrapper.getSocket().longValue();
 
         if (outputBuffer.position() > 0) {
             if ((socketRef != 0) && Socket.sendbb(socketRef, 0, outputBuffer.position()) < 0) {
@@ -314,7 +307,7 @@ public class AjpAprProcessor extends Abs
         int nRead;
         while (inputBuffer.remaining() < n) {
             nRead = Socket.recvbb
-                (socket.getSocket().longValue(), inputBuffer.limit(),
+                (socketWrapper.getSocket().longValue(), inputBuffer.limit(),
                         inputBuffer.capacity() - inputBuffer.limit());
             if (nRead > 0) {
                 inputBuffer.limit(inputBuffer.limit() + nRead);
@@ -347,7 +340,7 @@ public class AjpAprProcessor extends Abs
         int nRead;
         while (inputBuffer.remaining() < n) {
             nRead = Socket.recvbb
-                (socket.getSocket().longValue(), inputBuffer.limit(),
+                (socketWrapper.getSocket().longValue(), inputBuffer.limit(),
                     inputBuffer.capacity() - inputBuffer.limit());
             if (nRead > 0) {
                 inputBuffer.limit(inputBuffer.limit() + nRead);

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Thu Aug  8 21:09:38 2013
@@ -66,13 +66,6 @@ public class AjpNioProcessor extends Abs
 
     // ----------------------------------------------------- Instance Variables
 
-
-    /**
-     * Socket associated with the current connection.
-     */
-    protected NioChannel socket;
-
-
     /**
      * Selector pool for the associated endpoint.
      */
@@ -95,7 +88,7 @@ public class AjpNioProcessor extends Abs
         rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
 
         // Setting up the socket
-        this.socket = socket.getSocket();
+        this.socketWrapper = socket;
 
         long soTimeout = endpoint.getSoTimeout();
         boolean cping = false;
@@ -252,18 +245,21 @@ public class AjpNioProcessor extends Abs
 
         if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
-                ((NioEndpoint)endpoint).dispatchForEvent(socket, SocketStatus.OPEN_READ, false);
+                ((NioEndpoint)endpoint).dispatchForEvent(
+                        socketWrapper.getSocket(), SocketStatus.OPEN_READ, false);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param == null) return;
             long timeout = ((Long)param).longValue();
-            final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false);
+            final KeyAttachment ka =
+                    (KeyAttachment)socketWrapper.getSocket().getAttachment(false);
             if (keepAliveTimeout > 0) {
                 ka.setTimeout(timeout);
             }
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
-                ((NioEndpoint)endpoint).dispatchForEvent(socket, SocketStatus.OPEN_READ, true);            }
+                ((NioEndpoint)endpoint).dispatchForEvent(
+                        socketWrapper.getSocket(), SocketStatus.OPEN_READ, true);            }
             }
         }
 
@@ -274,10 +270,12 @@ public class AjpNioProcessor extends Abs
     protected void output(byte[] src, int offset, int length)
             throws IOException {
 
-        NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
+        NioEndpoint.KeyAttachment att =
+                (NioEndpoint.KeyAttachment) socketWrapper.getSocket().getAttachment(false);
         if ( att == null ) throw new IOException("Key must be cancelled");
 
-        ByteBuffer writeBuffer = socket.getBufHandler() .getWriteBuffer();
+        ByteBuffer writeBuffer =
+                socketWrapper.getSocket().getBufHandler().getWriteBuffer();
 
         writeBuffer.put(src, offset, length);
 
@@ -291,7 +289,8 @@ public class AjpNioProcessor extends Abs
             //ignore
         }
         try {
-            pool.write(writeBuffer, socket, selector, writeTimeout, true);
+            pool.write(writeBuffer, socketWrapper.getSocket(), selector,
+                    writeTimeout, true);
         }finally {
             writeBuffer.clear();
             if ( selector != null ) pool.put(selector);
@@ -326,8 +325,10 @@ public class AjpNioProcessor extends Abs
     private int readSocket(byte[] buf, int pos, int n, boolean block)
             throws IOException {
         int nRead = 0;
-        socket.getBufHandler().getReadBuffer().clear();
-        socket.getBufHandler().getReadBuffer().limit(n);
+        ByteBuffer readBuffer =
+                socketWrapper.getSocket().getBufHandler().getReadBuffer();
+        readBuffer.clear();
+        readBuffer.limit(n);
         if ( block ) {
             Selector selector = null;
             try {
@@ -336,21 +337,23 @@ public class AjpNioProcessor extends Abs
                 // Ignore
             }
             try {
-                NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
+                NioEndpoint.KeyAttachment att =
+                        (NioEndpoint.KeyAttachment) socketWrapper.getSocket().getAttachment(false);
                 if ( att == null ) throw new IOException("Key must be cancelled.");
-                nRead = pool.read(socket.getBufHandler().getReadBuffer(),socket,selector,att.getTimeout());
+                nRead = pool.read(readBuffer, socketWrapper.getSocket(),
+                        selector, att.getTimeout());
             } catch ( EOFException eof ) {
                 nRead = -1;
             } finally {
                 if ( selector != null ) pool.put(selector);
             }
         } else {
-            nRead = socket.read(socket.getBufHandler().getReadBuffer());
+            nRead = socketWrapper.getSocket().read(readBuffer);
         }
         if (nRead > 0) {
-            socket.getBufHandler().getReadBuffer().flip();
-            socket.getBufHandler().getReadBuffer().limit(nRead);
-            socket.getBufHandler().getReadBuffer().get(buf, pos, nRead);
+            readBuffer.flip();
+            readBuffer.limit(nRead);
+            readBuffer.get(buf, pos, nRead);
             return nRead;
         } else if (nRead == -1) {
             //return false;

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Thu Aug  8 21:09:38 2013
@@ -69,13 +69,6 @@ public class AjpProcessor extends Abstra
 
     // ----------------------------------------------------- Instance Variables
 
-
-    /**
-     * Socket associated with the current connection.
-     */
-    protected SocketWrapper<Socket> socket;
-
-
     /**
      * Input stream.
      */
@@ -104,7 +97,7 @@ public class AjpProcessor extends Abstra
         rp.setStage(org.apache.coyote.Constants.STAGE_PARSE);
 
         // Setting up the socket
-        this.socket = socket;
+        this.socketWrapper = socket;
         input = socket.getSocket().getInputStream();
         output = socket.getSocket().getOutputStream();
         int soTimeout = -1;
@@ -270,17 +263,17 @@ public class AjpProcessor extends Abstra
 
         if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
-                ((JIoEndpoint)endpoint).processSocketAsync(this.socket,
+                ((JIoEndpoint)endpoint).processSocketAsync(this.socketWrapper,
                         SocketStatus.OPEN_READ);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param == null) return;
             long timeout = ((Long)param).longValue();
             // if we are not piggy backing on a worker thread, set the timeout
-            socket.setTimeout(timeout);
+            socketWrapper.setTimeout(timeout);
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
-                ((JIoEndpoint)endpoint).processSocketAsync(this.socket,
+                ((JIoEndpoint)endpoint).processSocketAsync(this.socketWrapper,
                         SocketStatus.OPEN_READ);
             }
         }

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Thu Aug  8 21:09:38 2013
@@ -637,12 +637,6 @@ public abstract class AbstractHttp11Proc
 
 
     /**
-     * Allows the super class to set the socket wrapper being used.
-     */
-    protected abstract void setSocketWrapper(SocketWrapper<S> socketWrapper);
-
-
-    /**
      * Exposes input buffer to super class to allow better code re-use.
      * @return  The input buffer used by the processor.
      */

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Thu Aug  8 21:09:38 2013
@@ -523,11 +523,6 @@ public class Http11AprProcessor extends 
     }
 
     @Override
-    protected void setSocketWrapper(SocketWrapper<Long> socketWrapper) {
-        this.socket = socketWrapper;
-    }
-
-    @Override
     protected AbstractInputBuffer<Long> getInputBuffer() {
         return inputBuffer;
     }

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Thu Aug  8 21:09:38 2013
@@ -85,12 +85,6 @@ public class Http11NioProcessor extends 
     protected NioEndpoint.SendfileData sendfileData = null;
 
 
-    /**
-     * Socket associated with the current connection.
-     */
-    protected SocketWrapper<NioChannel> socket = null;
-
-
     // --------------------------------------------------------- Public Methods
 
     /**
@@ -106,7 +100,7 @@ public class Http11NioProcessor extends 
         long soTimeout = endpoint.getSoTimeout();
 
         RequestInfo rp = request.getRequestProcessor();
-        final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(false);
+        final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false);
         try {
             rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
             error = !getAdapter().event(request, response, status);
@@ -162,7 +156,7 @@ public class Http11NioProcessor extends 
     @Override
     protected void registerForEvent(boolean read, boolean write) {
         final NioEndpoint.KeyAttachment attach =
-                (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(
+                (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(
                         false);
         if (attach == null) {
             return;
@@ -178,7 +172,7 @@ public class Http11NioProcessor extends 
 
     @Override
     protected void resetTimeouts() {
-        final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(false);
+        final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false);
         if (!error && attach != null &&
                 asyncStateMachine.isAsyncDispatching()) {
             long soTimeout = endpoint.getSoTimeout();
@@ -228,17 +222,17 @@ public class Http11NioProcessor extends 
         // Check to see if we have read any of the request line yet
         if (((InternalNioInputBuffer)
                 inputBuffer).getParsingRequestLinePhase() < 2) {
-            if (socket.getLastAccess() > -1 || keptAlive) {
+            if (socketWrapper.getLastAccess() > -1 || keptAlive) {
                 // Haven't read the request line and have previously processed a
                 // request. Must be keep-alive. Make sure poller uses keepAlive.
-                socket.setTimeout(endpoint.getKeepAliveTimeout());
+                socketWrapper.setTimeout(endpoint.getKeepAliveTimeout());
             }
         } else {
             // Started to read request line. Need to keep processor
             // associated with socket
             readComplete = false;
             // Make sure poller uses soTimeout from here onwards
-            socket.setTimeout(endpoint.getSoTimeout());
+            socketWrapper.setTimeout(endpoint.getSoTimeout());
         }
         if (endpoint.isPaused()) {
             // 503 - Service unavailable
@@ -254,7 +248,7 @@ public class Http11NioProcessor extends 
 
     @Override
     protected void setSocketTimeout(int timeout) throws IOException {
-        socket.getSocket().getIOChannel().socket().setSoTimeout(timeout);
+        socketWrapper.getSocket().getIOChannel().socket().setSoTimeout(timeout);
     }
 
 
@@ -301,7 +295,7 @@ public class Http11NioProcessor extends 
 
     @Override
     public void recycleInternal() {
-        socket = null;
+        socketWrapper = null;
         sendfileData = null;
     }
 
@@ -320,87 +314,87 @@ public class Http11NioProcessor extends 
 
         if (actionCode == ActionCode.REQ_HOST_ADDR_ATTRIBUTE) {
 
-            if (socket == null) {
+            if (socketWrapper == null) {
                 request.remoteAddr().recycle();
             } else {
-                if (socket.getRemoteAddr() == null) {
-                    InetAddress inetAddr = socket.getSocket().getIOChannel().socket().getInetAddress();
+                if (socketWrapper.getRemoteAddr() == null) {
+                    InetAddress inetAddr = socketWrapper.getSocket().getIOChannel().socket().getInetAddress();
                     if (inetAddr != null) {
-                        socket.setRemoteAddr(inetAddr.getHostAddress());
+                        socketWrapper.setRemoteAddr(inetAddr.getHostAddress());
                     }
                 }
-                request.remoteAddr().setString(socket.getRemoteAddr());
+                request.remoteAddr().setString(socketWrapper.getRemoteAddr());
             }
 
         } else if (actionCode == ActionCode.REQ_LOCAL_NAME_ATTRIBUTE) {
 
-            if (socket == null) {
+            if (socketWrapper == null) {
                 request.localName().recycle();
             } else {
-                if (socket.getLocalName() == null) {
-                    InetAddress inetAddr = socket.getSocket().getIOChannel().socket().getLocalAddress();
+                if (socketWrapper.getLocalName() == null) {
+                    InetAddress inetAddr = socketWrapper.getSocket().getIOChannel().socket().getLocalAddress();
                     if (inetAddr != null) {
-                        socket.setLocalName(inetAddr.getHostName());
+                        socketWrapper.setLocalName(inetAddr.getHostName());
                     }
                 }
-                request.localName().setString(socket.getLocalName());
+                request.localName().setString(socketWrapper.getLocalName());
             }
 
         } else if (actionCode == ActionCode.REQ_HOST_ATTRIBUTE) {
 
-            if (socket == null) {
+            if (socketWrapper == null) {
                 request.remoteHost().recycle();
             } else {
-                if (socket.getRemoteHost() == null) {
-                    InetAddress inetAddr = socket.getSocket().getIOChannel().socket().getInetAddress();
+                if (socketWrapper.getRemoteHost() == null) {
+                    InetAddress inetAddr = socketWrapper.getSocket().getIOChannel().socket().getInetAddress();
                     if (inetAddr != null) {
-                        socket.setRemoteHost(inetAddr.getHostName());
+                        socketWrapper.setRemoteHost(inetAddr.getHostName());
                     }
-                    if (socket.getRemoteHost() == null) {
-                        if (socket.getRemoteAddr() == null &&
+                    if (socketWrapper.getRemoteHost() == null) {
+                        if (socketWrapper.getRemoteAddr() == null &&
                                 inetAddr != null) {
-                            socket.setRemoteAddr(inetAddr.getHostAddress());
+                            socketWrapper.setRemoteAddr(inetAddr.getHostAddress());
                         }
-                        if (socket.getRemoteAddr() != null) {
-                            socket.setRemoteHost(socket.getRemoteAddr());
+                        if (socketWrapper.getRemoteAddr() != null) {
+                            socketWrapper.setRemoteHost(socketWrapper.getRemoteAddr());
                         }
                     }
                 }
-                request.remoteHost().setString(socket.getRemoteHost());
+                request.remoteHost().setString(socketWrapper.getRemoteHost());
             }
 
         } else if (actionCode == ActionCode.REQ_LOCAL_ADDR_ATTRIBUTE) {
 
-            if (socket == null) {
+            if (socketWrapper == null) {
                 request.localAddr().recycle();
             } else {
-                if (socket.getLocalAddr() == null) {
-                    socket.setLocalAddr(
-                            socket.getSocket().getIOChannel().socket().getLocalAddress().getHostAddress());
+                if (socketWrapper.getLocalAddr() == null) {
+                    socketWrapper.setLocalAddr(
+                            socketWrapper.getSocket().getIOChannel().socket().getLocalAddress().getHostAddress());
                 }
-                request.localAddr().setString(socket.getLocalAddr());
+                request.localAddr().setString(socketWrapper.getLocalAddr());
             }
 
         } else if (actionCode == ActionCode.REQ_REMOTEPORT_ATTRIBUTE) {
 
-            if (socket == null) {
+            if (socketWrapper == null) {
                 request.setRemotePort(0);
             } else {
-                if (socket.getRemotePort() == -1) {
-                    socket.setRemotePort(socket.getSocket().getIOChannel().socket().getPort());
+                if (socketWrapper.getRemotePort() == -1) {
+                    socketWrapper.setRemotePort(socketWrapper.getSocket().getIOChannel().socket().getPort());
                 }
-                request.setRemotePort(socket.getRemotePort());
+                request.setRemotePort(socketWrapper.getRemotePort());
             }
 
         } else if (actionCode == ActionCode.REQ_LOCALPORT_ATTRIBUTE) {
 
-            if (socket == null) {
+            if (socketWrapper == null) {
                 request.setLocalPort(0);
             } else {
-                if (socket.getLocalPort() == -1) {
-                    socket.setLocalPort(socket.getSocket().getIOChannel().socket().getLocalPort());
+                if (socketWrapper.getLocalPort() == -1) {
+                    socketWrapper.setLocalPort(socketWrapper.getSocket().getIOChannel().socket().getLocalPort());
                 }
-                request.setLocalPort(socket.getLocalPort());
+                request.setLocalPort(socketWrapper.getLocalPort());
             }
 
         } else if (actionCode == ActionCode.REQ_SSL_ATTRIBUTE ) {
@@ -445,7 +439,7 @@ public class Http11NioProcessor extends 
                     .setLimit(maxSavePostSize);
                 inputBuffer.addActiveFilter
                     (inputFilters[Constants.BUFFERED_FILTER]);
-                SecureNioChannel sslChannel = (SecureNioChannel) socket.getSocket();
+                SecureNioChannel sslChannel = (SecureNioChannel) socketWrapper.getSocket();
                 SSLEngine engine = sslChannel.getSslEngine();
                 if (!engine.getNeedClientAuth()) {
                     // Need to re-negotiate SSL connection
@@ -477,7 +471,7 @@ public class Http11NioProcessor extends 
         } else if (actionCode == ActionCode.COMET_END) {
             comet = false;
         } else if (actionCode == ActionCode.COMET_CLOSE) {
-            if (socket==null || socket.getSocket().getAttachment(false)==null) {
+            if (socketWrapper==null || socketWrapper.getSocket().getAttachment(false)==null) {
                 return;
             }
             RequestInfo rp = request.getRequestProcessor();
@@ -485,16 +479,16 @@ public class Http11NioProcessor extends 
                 // Close event for this processor triggered by request
                 // processing in another processor, a non-Tomcat thread (i.e.
                 // an application controlled thread) or similar.
-                socket.getSocket().getPoller().add(socket.getSocket());
+                socketWrapper.getSocket().getPoller().add(socketWrapper.getSocket());
             }
         } else if (actionCode == ActionCode.COMET_SETTIMEOUT) {
             if (param==null) {
                 return;
             }
-            if (socket==null || socket.getSocket().getAttachment(false)==null) {
+            if (socketWrapper==null || socketWrapper.getSocket().getAttachment(false)==null) {
                 return;
             }
-            NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(false);
+            NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false);
             long timeout = ((Long)param).longValue();
             //if we are not piggy backing on a worker thread, set the timeout
             RequestInfo rp = request.getRequestProcessor();
@@ -503,22 +497,22 @@ public class Http11NioProcessor extends 
             }
         } else if (actionCode == ActionCode.ASYNC_COMPLETE) {
             if (asyncStateMachine.asyncComplete()) {
-                ((NioEndpoint)endpoint).dispatchForEvent(this.socket.getSocket(),SocketStatus.OPEN_READ, true);
+                ((NioEndpoint)endpoint).dispatchForEvent(this.socketWrapper.getSocket(),SocketStatus.OPEN_READ, true);
             }
         } else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
             if (param==null) {
                 return;
             }
-            if (socket==null || socket.getSocket().getAttachment(false)==null) {
+            if (socketWrapper==null || socketWrapper.getSocket().getAttachment(false)==null) {
                 return;
             }
-            NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(false);
+            NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false);
             long timeout = ((Long)param).longValue();
             //if we are not piggy backing on a worker thread, set the timeout
             attach.setTimeout(timeout);
         } else if (actionCode == ActionCode.ASYNC_DISPATCH) {
             if (asyncStateMachine.asyncDispatch()) {
-                ((NioEndpoint)endpoint).dispatchForEvent(this.socket.getSocket(),SocketStatus.OPEN_READ, true);
+                ((NioEndpoint)endpoint).dispatchForEvent(this.socketWrapper.getSocket(),SocketStatus.OPEN_READ, true);
             }
         }
     }
@@ -552,11 +546,6 @@ public class Http11NioProcessor extends 
     }
 
     @Override
-    protected void setSocketWrapper(SocketWrapper<NioChannel> socketWrapper) {
-        this.socket = socketWrapper;
-    }
-
-    @Override
     protected AbstractInputBuffer<NioChannel> getInputBuffer() {
         return inputBuffer;
     }

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1512034&r1=1512033&r2=1512034&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Thu Aug  8 21:09:38 2013
@@ -410,11 +410,6 @@ public class Http11Processor extends Abs
     }
 
     @Override
-    protected void setSocketWrapper(SocketWrapper<Socket> socketWrapper) {
-        this.socket = socketWrapper;
-    }
-
-    @Override
     protected AbstractInputBuffer<Socket> getInputBuffer() {
         return inputBuffer;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org