This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new d54f6c6 More debug logging to help with intermittent CI failures d54f6c6 is described below commit d54f6c6ba9a79e6902912a0f1f0a6375a5279439 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Sep 10 09:51:23 2020 +0100 More debug logging to help with intermittent CI failures --- java/org/apache/tomcat/websocket/AsyncChannelWrapper.java | 4 ++++ .../org/apache/tomcat/websocket/AsyncChannelWrapperNonSecure.java | 7 +++++++ java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java | 7 +++++++ java/org/apache/tomcat/websocket/LocalStrings.properties | 2 +- java/org/apache/tomcat/websocket/WsWebSocketContainer.java | 8 +++++++- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/java/org/apache/tomcat/websocket/AsyncChannelWrapper.java b/java/org/apache/tomcat/websocket/AsyncChannelWrapper.java index d970d75..cd6fc78 100644 --- a/java/org/apache/tomcat/websocket/AsyncChannelWrapper.java +++ b/java/org/apache/tomcat/websocket/AsyncChannelWrapper.java @@ -16,6 +16,8 @@ */ package org.apache.tomcat.websocket; +import java.io.IOException; +import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; import java.util.concurrent.Future; @@ -44,4 +46,6 @@ public interface AsyncChannelWrapper { void close(); Future<Void> handshake() throws SSLException; + + SocketAddress getLocalAddress() throws IOException; } diff --git a/java/org/apache/tomcat/websocket/AsyncChannelWrapperNonSecure.java b/java/org/apache/tomcat/websocket/AsyncChannelWrapperNonSecure.java index d86c22c..f28ef87 100644 --- a/java/org/apache/tomcat/websocket/AsyncChannelWrapperNonSecure.java +++ b/java/org/apache/tomcat/websocket/AsyncChannelWrapperNonSecure.java @@ -17,6 +17,7 @@ package org.apache.tomcat.websocket; import java.io.IOException; +import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousSocketChannel; import java.nio.channels.CompletionHandler; @@ -80,6 +81,12 @@ public class AsyncChannelWrapperNonSecure implements AsyncChannelWrapper { } + @Override + public SocketAddress getLocalAddress() throws IOException { + return socketChannel.getLocalAddress(); + } + + private static final class NoOpFuture implements Future<Void> { @Override diff --git a/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java b/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java index c844418..a72949e 100644 --- a/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java +++ b/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java @@ -18,6 +18,7 @@ package org.apache.tomcat.websocket; import java.io.EOFException; import java.io.IOException; +import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousSocketChannel; import java.nio.channels.CompletionHandler; @@ -166,6 +167,12 @@ public class AsyncChannelWrapperSecure implements AsyncChannelWrapper { } + @Override + public SocketAddress getLocalAddress() throws IOException { + return socketChannel.getLocalAddress(); + } + + private class WriteTask implements Runnable { private final ByteBuffer[] srcs; diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties b/java/org/apache/tomcat/websocket/LocalStrings.properties index 03b7923..7a3489d 100644 --- a/java/org/apache/tomcat/websocket/LocalStrings.properties +++ b/java/org/apache/tomcat/websocket/LocalStrings.properties @@ -129,7 +129,7 @@ wsWebSocketContainer.shutdown=The web application is stopping wsWebSocketContainer.asynchronousSocketChannelFail=Unable to open a connection to the server wsWebSocketContainer.connect.entry=Connecting endpoint instance of type [{0}] to [{1}] -wsWebSocketContainer.connect.write=Writing the HTTP upgrade request from buffer starting at [{0}] with a limit of [{1}] +wsWebSocketContainer.connect.write=Writing the HTTP upgrade request from buffer starting at [{0}] with a limit of [{1}] from local address [{2}] wsWebSocketContainer.defaultConfiguratorFail=Failed to create the default configurator wsWebSocketContainer.endpointCreateFail=Failed to create a local endpoint of type [{0}] wsWebSocketContainer.failedAuthentication=Failed to handle HTTP response code [{0}]. Authentication header was not accepted by server. diff --git a/java/org/apache/tomcat/websocket/WsWebSocketContainer.java b/java/org/apache/tomcat/websocket/WsWebSocketContainer.java index 4949759..937dca0 100644 --- a/java/org/apache/tomcat/websocket/WsWebSocketContainer.java +++ b/java/org/apache/tomcat/websocket/WsWebSocketContainer.java @@ -350,8 +350,14 @@ public class WsWebSocketContainer implements WebSocketContainer, BackgroundProce fHandshake.get(timeout, TimeUnit.MILLISECONDS); if (log.isDebugEnabled()) { + SocketAddress localAddress = null; + try { + localAddress = channel.getLocalAddress(); + } catch (IOException ioe) { + // Ignore + } log.debug(sm.getString("wsWebSocketContainer.connect.write", - Integer.valueOf(request.position()), Integer.valueOf(request.limit()))); + Integer.valueOf(request.position()), Integer.valueOf(request.limit()), localAddress)); } writeRequest(channel, request, timeout); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org