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 03e7f73 Fix BZ 65763 - improve handling of timeout during message
write
03e7f73 is described below
commit 03e7f73bfa170e696672210082a818dcf8718fb9
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Jan 6 14:12:49 2022 +0000
Fix BZ 65763 - improve handling of timeout during message write
https://bz.apache.org/bugzilla/show_bug.cgi?id=65763
---
java/org/apache/tomcat/websocket/WsSession.java | 3 +--
webapps/docs/changelog.xml | 4 ++++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/tomcat/websocket/WsSession.java
b/java/org/apache/tomcat/websocket/WsSession.java
index b728d51..dc952c1 100644
--- a/java/org/apache/tomcat/websocket/WsSession.java
+++ b/java/org/apache/tomcat/websocket/WsSession.java
@@ -19,7 +19,6 @@ package org.apache.tomcat.websocket;
import java.io.IOException;
import java.net.URI;
import java.nio.ByteBuffer;
-import java.nio.channels.WritePendingException;
import java.nio.charset.StandardCharsets;
import java.security.Principal;
import java.util.Collections;
@@ -814,7 +813,7 @@ public class WsSession implements Session {
msg.flip();
try {
wsRemoteEndpoint.sendMessageBlock(Constants.OPCODE_CLOSE, msg,
true);
- } catch (IOException | WritePendingException e) {
+ } catch (IOException | IllegalStateException e) {
// Failed to send close message. Close the socket and let the
caller
// deal with the Exception
if (log.isDebugEnabled()) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b9f71f5..7c3de4e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -222,6 +222,10 @@
that allows applications to opt to upgrade an HTTP connection to
WebSocket. (markt)
</add>
+ <fix>
+ <bug>65763</bug>: Improve handling of WebSocket connection close if a
+ message write times out before the message is fully written. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]