This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new f9b5852899 Fix regression in fix for BZ 66574
f9b5852899 is described below
commit f9b585289985e650b5e55adb30cfa0e41c5120ea
Author: Mark Thomas <[email protected]>
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 35ac8ad4cd..8feb5ea9b6 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: [email protected]
For additional commands, e-mail: [email protected]