From 7e73009a5081cdf9daa157eae516789b1f675673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Mon, 25 Sep 2023 11:12:20 +0200 Subject: [PATCH 1/2] Fix getPort function ignoring offset for tomcat-8.5/9.0 --- .../org/jboss/modcluster/container/tomcat/TomcatConnector.java | 2 +- .../org/jboss/modcluster/container/tomcat/TomcatConnector.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java b/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java index 1652d0a5d..6fefd06eb 100644 --- a/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java +++ b/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java @@ -95,7 +95,7 @@ public void setAddress(InetAddress address) { @Override public int getPort() { - return (this.externalPort == null) ? this.connector.getPort() : this.externalPort; + return (this.externalPort == null) ? this.connector.getPortWithOffset() : this.externalPort; } @Override diff --git a/container/tomcat-9.0/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java b/container/tomcat-9.0/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java index 1652d0a5d..6fefd06eb 100644 --- a/container/tomcat-9.0/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java +++ b/container/tomcat-9.0/src/main/java/org/jboss/modcluster/container/tomcat/TomcatConnector.java @@ -95,7 +95,7 @@ public void setAddress(InetAddress address) { @Override public int getPort() { - return (this.externalPort == null) ? this.connector.getPort() : this.externalPort; + return (this.externalPort == null) ? this.connector.getPortWithOffset() : this.externalPort; } @Override From a0011b11c1aa35328e1536fcb2236f5594e7f887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Chlup?= Date: Mon, 25 Sep 2023 11:12:44 +0200 Subject: [PATCH 2/2] Fix getPortWithOffset for tomcat-8.5 --- .../jboss/modcluster/container/tomcat/SingleServiceServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/SingleServiceServer.java b/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/SingleServiceServer.java index 522421de6..b78efdb06 100644 --- a/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/SingleServiceServer.java +++ b/container/tomcat-8.5/src/main/java/org/jboss/modcluster/container/tomcat/SingleServiceServer.java @@ -100,7 +100,7 @@ public void setPortOffset(int i) { @Override public int getPortWithOffset() { - return this.service.getServer().getPort(); + return this.service.getServer().getPortWithOffset(); } @Override