This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new 0eaa09a Move handler release code to the superclass
0eaa09a is described below
commit 0eaa09a90c657f4a461c7adeff4e69b6ac9c032c
Author: remm <[email protected]>
AuthorDate: Thu Oct 3 10:32:06 2019 +0200
Move handler release code to the superclass
No idea why I didn't notice it earlier since it's quite obvious.
---
java/org/apache/tomcat/util/net/AprEndpoint.java | 8 --------
java/org/apache/tomcat/util/net/Nio2Endpoint.java | 8 --------
java/org/apache/tomcat/util/net/NioEndpoint.java | 8 --------
java/org/apache/tomcat/util/net/SocketWrapperBase.java | 8 ++++++++
4 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index bd7149d..3f9cb3b 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -2244,14 +2244,6 @@ public class AprEndpoint extends
AbstractEndpoint<Long,Long> implements SNICallB
if (log.isDebugEnabled()) {
log.debug("Calling [" + getEndpoint() + "].closeSocket([" +
this + "])", new Exception());
}
- try {
- getEndpoint().getHandler().release(this);
- } catch (Throwable e) {
- ExceptionUtils.handleThrowable(e);
- if (log.isDebugEnabled()) {
- log.error(sm.getString("endpoint.debug.handlerRelease"),
e);
- }
- }
socketBufferHandler = SocketBufferHandler.EMPTY;
nonBlockingWriteBuffer.clear();
synchronized (closed) {
diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index 0ff7c4f..4bb8ba1 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -915,14 +915,6 @@ public class Nio2Endpoint extends
AbstractJsseEndpoint<Nio2Channel,AsynchronousS
log.debug("Calling [" + getEndpoint() + "].closeSocket([" +
this + "])", new Exception());
}
try {
- getEndpoint().getHandler().release(this);
- } catch (Throwable e) {
- ExceptionUtils.handleThrowable(e);
- if (log.isDebugEnabled()) {
- log.error(sm.getString("endpoint.debug.handlerRelease"),
e);
- }
- }
- try {
synchronized (getSocket()) {
getEndpoint().countDownConnection();
if (getSocket().isOpen()) {
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 99d8896..c23bfc9 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1163,14 +1163,6 @@ public class NioEndpoint extends
AbstractJsseEndpoint<NioChannel,SocketChannel>
log.debug("Calling [" + getEndpoint() + "].closeSocket([" +
this + "])", new Exception());
}
try {
- getEndpoint().getHandler().release(this);
- } catch (Throwable e) {
- ExceptionUtils.handleThrowable(e);
- if (log.isDebugEnabled()) {
- log.error(sm.getString("endpoint.debug.handlerRelease"),
e);
- }
- }
- try {
synchronized (getSocket()) {
getEndpoint().countDownConnection();
if (getSocket().isOpen()) {
diff --git a/java/org/apache/tomcat/util/net/SocketWrapperBase.java
b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
index d4af16b..2c082d6 100644
--- a/java/org/apache/tomcat/util/net/SocketWrapperBase.java
+++ b/java/org/apache/tomcat/util/net/SocketWrapperBase.java
@@ -391,6 +391,14 @@ public abstract class SocketWrapperBase<E> {
*/
public void close() {
if (closed.compareAndSet(false, true)) {
+ try {
+ getEndpoint().getHandler().release(this);
+ } catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
+ if (log.isDebugEnabled()) {
+ log.error(sm.getString("endpoint.debug.handlerRelease"),
e);
+ }
+ }
doClose();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]