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
commit 4fcebd519213b8771988af5139be490627974b5a Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Aug 7 16:04:22 2024 +0100 Add trace logging for receipt of WebSocket session close message --- java/org/apache/tomcat/websocket/LocalStrings.properties | 1 + java/org/apache/tomcat/websocket/WsSession.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/java/org/apache/tomcat/websocket/LocalStrings.properties b/java/org/apache/tomcat/websocket/LocalStrings.properties index d39cbcc108..bd90ab3c42 100644 --- a/java/org/apache/tomcat/websocket/LocalStrings.properties +++ b/java/org/apache/tomcat/websocket/LocalStrings.properties @@ -118,6 +118,7 @@ wsSession.instanceCreateFailed=Endpoint instance creation failed wsSession.instanceNew=Endpoint instance registration failed wsSession.invalidHandlerTypePong=A pong message handler must implement MessageHandler.Whole wsSession.messageFailed=Unable to write the complete message as the WebSocket connection has been closed +wsSession.onClose.entry=Close message with reason [{0}] received for session [{1}] in state [{2}] wsSession.removeHandlerFailed=Unable to remove the handler [{0}] as it was not registered with this session wsSession.sendCloseFail=Failed to send close message for session [{0}] to remote endpoint wsSession.timeout=The WebSocket session [{0}] idle timeout expired diff --git a/java/org/apache/tomcat/websocket/WsSession.java b/java/org/apache/tomcat/websocket/WsSession.java index 8892e7d960..bf7437af6e 100644 --- a/java/org/apache/tomcat/websocket/WsSession.java +++ b/java/org/apache/tomcat/websocket/WsSession.java @@ -704,6 +704,9 @@ public class WsSession implements Session { * @param closeReason The reason contained within the received close message. */ public void onClose(CloseReason closeReason) { + if (log.isTraceEnabled()) { + log.trace(sm.getString("wsSession.onClose.entry", closeReason, getId(), state)); + } if (state.compareAndSet(State.OPEN, State.CLOSING)) { // Standard close. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org