Author: markt
Date: Wed Feb 12 15:19:49 2014
New Revision: 1567644
URL: http://svn.apache.org/r1567644
Log:
Additional fixes required to r1567632. Missed due to naming differences between
trunk and 7.0.x
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1567644&r1=1567643&r2=1567644&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
Wed Feb 12 15:19:49 2014
@@ -94,12 +94,6 @@ public class Http11AprProcessor extends
/**
- * Socket associated with the current connection.
- */
- protected SocketWrapper<Long> socket = null;
-
-
- /**
* When client certificate information is presented in a form other than
* instances of {@link java.security.cert.X509Certificate} it needs to be
* converted before it can be used and this property controls which JSSE
@@ -205,7 +199,7 @@ public class Http11AprProcessor extends
@Override
protected void setSocketTimeout(int timeout) {
- Socket.timeoutSet(socket.getSocket().longValue(), timeout * 1000);
+ Socket.timeoutSet(socketWrapper.getSocket().longValue(), timeout *
1000);
}
@@ -252,7 +246,7 @@ public class Http11AprProcessor extends
@Override
public void recycleInternal() {
- socket = null;
+ socketWrapper = null;
sendfileData = null;
}
@@ -274,7 +268,7 @@ public class Http11AprProcessor extends
@Override
public void actionInternal(ActionCode actionCode, Object param) {
- long socketRef = socket.getSocket().longValue();
+ long socketRef = socketWrapper.getSocket().longValue();
if (actionCode == ActionCode.REQ_HOST_ADDR_ATTRIBUTE) {
@@ -454,13 +448,13 @@ public class Http11AprProcessor extends
} else if (actionCode == ActionCode.COMET_END) {
comet = false;
} else if (actionCode == ActionCode.COMET_CLOSE) {
- ((AprEndpoint)endpoint).processSocketAsync(this.socket,
+ ((AprEndpoint)endpoint).processSocketAsync(this.socketWrapper,
SocketStatus.OPEN_READ);
} else if (actionCode == ActionCode.COMET_SETTIMEOUT) {
//no op
} else 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) {
@@ -468,10 +462,10 @@ public class Http11AprProcessor extends
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);
}
}
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1567644&r1=1567643&r2=1567644&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java Wed
Feb 12 15:19:49 2014
@@ -86,12 +86,6 @@ public class Http11Processor extends Abs
/**
- * Socket associated with the current connection.
- */
- protected SocketWrapper<Socket> socket;
-
-
- /**
* The percentage of threads that have to be in use before keep-alive is
* disabled to aid scalability.
*/
@@ -151,13 +145,13 @@ public class Http11Processor extends Abs
* This is a little hacky but better than exposing the socket
* and the timeout info to the InputBuffer
*/
- if (inputBuffer.lastValid == 0 && socket.getLastAccess() > -1) {
+ if (inputBuffer.lastValid == 0 && socketWrapper.getLastAccess() > -1) {
int firstReadTimeout;
if (keepAliveTimeout == -1) {
firstReadTimeout = 0;
} else {
long queueTime =
- System.currentTimeMillis() - socket.getLastAccess();
+ System.currentTimeMillis() - socketWrapper.getLastAccess();
if (queueTime >= keepAliveTimeout) {
// Queued for longer than timeout but there might be
@@ -169,7 +163,7 @@ public class Http11Processor extends Abs
firstReadTimeout = keepAliveTimeout - (int) queueTime;
}
}
- socket.getSocket().setSoTimeout(firstReadTimeout);
+ socketWrapper.getSocket().setSoTimeout(firstReadTimeout);
if (!inputBuffer.fill()) {
throw new EOFException(sm.getString("iib.eof.error"));
}
@@ -193,7 +187,7 @@ public class Http11Processor extends Abs
@Override
protected void setSocketTimeout(int timeout) throws IOException {
- socket.getSocket().setSoTimeout(timeout);
+ socketWrapper.getSocket().setSoTimeout(timeout);
}
@@ -224,7 +218,7 @@ public class Http11Processor extends Abs
@Override
protected void recycleInternal() {
// Recycle
- this.socket = null;
+ this.socketWrapper = null;
// Recycle ssl info
sslSupport = null;
}
@@ -277,8 +271,8 @@ public class Http11Processor extends Abs
} else if (actionCode == ActionCode.REQ_HOST_ADDR_ATTRIBUTE) {
- if ((remoteAddr == null) && (socket != null)) {
- InetAddress inetAddr = socket.getSocket().getInetAddress();
+ if ((remoteAddr == null) && (socketWrapper != null)) {
+ InetAddress inetAddr =
socketWrapper.getSocket().getInetAddress();
if (inetAddr != null) {
remoteAddr = inetAddr.getHostAddress();
}
@@ -287,8 +281,8 @@ public class Http11Processor extends Abs
} else if (actionCode == ActionCode.REQ_LOCAL_NAME_ATTRIBUTE) {
- if ((localName == null) && (socket != null)) {
- InetAddress inetAddr = socket.getSocket().getLocalAddress();
+ if ((localName == null) && (socketWrapper != null)) {
+ InetAddress inetAddr =
socketWrapper.getSocket().getLocalAddress();
if (inetAddr != null) {
localName = inetAddr.getHostName();
}
@@ -297,8 +291,8 @@ public class Http11Processor extends Abs
} else if (actionCode == ActionCode.REQ_HOST_ATTRIBUTE) {
- if ((remoteHost == null) && (socket != null)) {
- InetAddress inetAddr = socket.getSocket().getInetAddress();
+ if ((remoteHost == null) && (socketWrapper != null)) {
+ InetAddress inetAddr =
socketWrapper.getSocket().getInetAddress();
if (inetAddr != null) {
remoteHost = inetAddr.getHostName();
}
@@ -315,21 +309,21 @@ public class Http11Processor extends Abs
} else if (actionCode == ActionCode.REQ_LOCAL_ADDR_ATTRIBUTE) {
if (localAddr == null)
- localAddr =
socket.getSocket().getLocalAddress().getHostAddress();
+ localAddr =
socketWrapper.getSocket().getLocalAddress().getHostAddress();
request.localAddr().setString(localAddr);
} else if (actionCode == ActionCode.REQ_REMOTEPORT_ATTRIBUTE) {
- if ((remotePort == -1 ) && (socket !=null)) {
- remotePort = socket.getSocket().getPort();
+ if ((remotePort == -1 ) && (socketWrapper !=null)) {
+ remotePort = socketWrapper.getSocket().getPort();
}
request.setRemotePort(remotePort);
} else if (actionCode == ActionCode.REQ_LOCALPORT_ATTRIBUTE) {
- if ((localPort == -1 ) && (socket !=null)) {
- localPort = socket.getSocket().getLocalPort();
+ if ((localPort == -1 ) && (socketWrapper !=null)) {
+ localPort = socketWrapper.getSocket().getLocalPort();
}
request.setLocalPort(localPort);
@@ -356,17 +350,17 @@ public class Http11Processor extends Abs
}
} else 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);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]