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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new bf8f666230 Use finally for init
bf8f666230 is described below

commit bf8f66623076a0427a61f363236c0ce5c3bd4e45
Author: remm <[email protected]>
AuthorDate: Wed Oct 30 10:01:53 2024 +0100

    Use finally for init
---
 .../org/apache/coyote/http11/AbstractHttp11Protocol.java | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index bb2f36c1a2..f48dcd82d5 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -79,13 +79,15 @@ public abstract class AbstractHttp11Protocol<S> extends 
AbstractProtocol<S> {
             configureUpgradeProtocol(upgradeProtocol);
         }
 
-        super.init();
-
-        // Set the Http11Protocol (i.e. this) for any upgrade protocols once
-        // this has completed initialisation as the upgrade protocols may 
expect this
-        // to be initialised when the call is made
-        for (UpgradeProtocol upgradeProtocol : upgradeProtocols) {
-            upgradeProtocol.setHttp11Protocol(this);
+        try {
+            super.init();
+        } finally {
+            // Set the Http11Protocol (i.e. this) for any upgrade protocols 
once
+            // this has completed initialisation as the upgrade protocols may 
expect this
+            // to be initialised when the call is made
+            for (UpgradeProtocol upgradeProtocol : upgradeProtocols) {
+                upgradeProtocol.setHttp11Protocol(this);
+            }
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to