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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 8f057b62a3 Pull up creation of Handler
8f057b62a3 is described below

commit 8f057b62a3d49f4be452a32ab24c8f6b23059f22
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 461d04dc0c..b3d375437d 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -93,6 +93,9 @@ public abstract class AbstractProtocol<S> implements 
ProtocolHandler,
 
     public AbstractProtocol(AbstractEndpoint<S,?> endpoint) {
         this.endpoint = endpoint;
+        ConnectionHandler<S> cHandler = new ConnectionHandler<>(this);
+        setHandler(cHandler);
+        getEndpoint().setHandler(cHandler);
         setSoLinger(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 70f392fbbd..89d51b40ee 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 aedf32eefa..82d0a7166e 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -62,9 +62,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