This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new d0f82bd59f Pull up creation of Handler
d0f82bd59f is described below

commit d0f82bd59f67f50f2f7c5a5ef276fc402ba9d287
Author: lihan <li...@apache.org>
AuthorDate: Sun Sep 4 20:52:30 2022 +0800

    Pull up creation of Handler
---
 java/org/apache/coyote/AbstractProtocol.java              | 3 +++
 java/org/apache/coyote/ajp/AbstractAjpProtocol.java       | 3 ---
 java/org/apache/coyote/http11/AbstractHttp11Protocol.java | 3 ---
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index 449d662f54..e21f6b731e 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -97,6 +97,9 @@ public abstract class AbstractProtocol<S> implements 
ProtocolHandler,
 
     public AbstractProtocol(AbstractEndpoint<S,?> endpoint) {
         this.endpoint = endpoint;
+        ConnectionHandler<S> cHandler = new ConnectionHandler<>(this);
+        getEndpoint().setHandler(cHandler);
+        setHandler(cHandler);
         setConnectionLinger(Constants.DEFAULT_CONNECTION_LINGER);
         setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
     }
diff --git a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java 
b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
index 93f0babc39..e822c29af9 100644
--- a/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
+++ b/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
@@ -51,9 +51,6 @@ public abstract class AbstractAjpProtocol<S> extends 
AbstractProtocol<S> {
         getEndpoint().setUseSendfile(false);
         // AJP listens on loopback by default
         getEndpoint().setAddress(InetAddress.getLoopbackAddress());
-        ConnectionHandler<S> cHandler = new ConnectionHandler<>(this);
-        setHandler(cHandler);
-        getEndpoint().setHandler(cHandler);
     }
 
 
diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index c33ab7035a..4b90ac7e8c 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -64,9 +64,6 @@ public abstract class AbstractHttp11Protocol<S> extends 
AbstractProtocol<S> {
     public AbstractHttp11Protocol(AbstractEndpoint<S,?> endpoint) {
         super(endpoint);
         setConnectionTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
-        ConnectionHandler<S> cHandler = new ConnectionHandler<>(this);
-        setHandler(cHandler);
-        getEndpoint().setHandler(cHandler);
     }
 
 


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

Reply via email to