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 74771aae3b Fix regression in fix for BZ 66574 74771aae3b is described below commit 74771aae3be44070133d64c9100a56ea0cdfecf1 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jun 16 14:50:28 2023 +0100 Fix regression in fix for BZ 66574 WebSocket session should report open until after the onClose event has completed. --- java/org/apache/tomcat/websocket/WsSession.java | 2 +- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/java/org/apache/tomcat/websocket/WsSession.java b/java/org/apache/tomcat/websocket/WsSession.java index d8dfb15e9c..3d5ebdbf10 100644 --- a/java/org/apache/tomcat/websocket/WsSession.java +++ b/java/org/apache/tomcat/websocket/WsSession.java @@ -542,7 +542,7 @@ public class WsSession implements Session { @Override public boolean isOpen() { - return state.get() == State.OPEN; + return state.get() == State.OPEN || state.get() == State.OUTPUT_CLOSING; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index a9fc3a13ea..95df3223ec 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -141,6 +141,11 @@ Improve handling of error conditions for the WebSocket server, particularly during Tomcat shutdown. (markt) </fix> + <fix> + Correct a regression in the fix for <bug>66574</bug> that meant the + WebSocket session could return false for <code>onOpen()</code> before + the <code>onClose()</code> event had been completed. (markt) + </fix> </changelog> </subsection> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org