This is an automated email from the ASF dual-hosted git repository.
markt 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 6980aadca8 Improve the acceptor unlock process
6980aadca8 is described below
commit 6980aadca8a6a1576f26e1b740138c0ca102d50e
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Jun 14 20:11:32 2024 +0100
Improve the acceptor unlock process
---
.../apache/tomcat/util/net/AbstractEndpoint.java | 30 ++++++++++++----------
webapps/docs/changelog.xml | 10 ++++++++
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 76dbf09d42..4971c9dbfb 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -1348,21 +1348,23 @@ public abstract class AbstractEndpoint<S,U> {
Enumeration<NetworkInterface> networkInterfaces =
NetworkInterface.getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
NetworkInterface networkInterface =
networkInterfaces.nextElement();
- Enumeration<InetAddress> inetAddresses =
networkInterface.getInetAddresses();
- while (inetAddresses.hasMoreElements()) {
- InetAddress inetAddress = inetAddresses.nextElement();
- if
(localAddress.getAddress().getClass().isAssignableFrom(inetAddress.getClass()))
{
- if (inetAddress.isLoopbackAddress()) {
- if (loopbackUnlockAddress == null) {
- loopbackUnlockAddress = inetAddress;
+ if (!networkInterface.isPointToPoint() &&
networkInterface.isUp()) {
+ Enumeration<InetAddress> inetAddresses =
networkInterface.getInetAddresses();
+ while (inetAddresses.hasMoreElements()) {
+ InetAddress inetAddress = inetAddresses.nextElement();
+ if
(localAddress.getAddress().getClass().isAssignableFrom(inetAddress.getClass()))
{
+ if (inetAddress.isLoopbackAddress()) {
+ if (loopbackUnlockAddress == null) {
+ loopbackUnlockAddress = inetAddress;
+ }
+ } else if (inetAddress.isLinkLocalAddress()) {
+ if (linkLocalUnlockAddress == null) {
+ linkLocalUnlockAddress = inetAddress;
+ }
+ } else {
+ // Use a non-link local, non-loop back address
by default
+ return new InetSocketAddress(inetAddress,
localAddress.getPort());
}
- } else if (inetAddress.isLinkLocalAddress()) {
- if (linkLocalUnlockAddress == null) {
- linkLocalUnlockAddress = inetAddress;
- }
- } else {
- // Use a non-link local, non-loop back address by
default
- return new InetSocketAddress(inetAddress,
localAddress.getPort());
}
}
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index cf8cbcd105..50b7674cc2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,16 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 11.0.0-M22 (markt)" rtext="in development">
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Improve the algorithm used to identify the IP address to use to unlock
+ the acceptor thread when a Connector is listening on all local
+ addresses. Interfaces that are configured for point to point
connections
+ or are not currently up are now skipped. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="Tomcat 11.0.0-M21 (markt)" rtext="release in progress">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]