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 18c886165a Further fix for BZ 66508
18c886165a is described below
commit 18c886165aa2590147d92a72d9a09051e98f3689
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Mar 16 14:41:44 2023 +0000
Further fix for BZ 66508
Address the other code path where error handling needs to clear any
in-progress write before trying to write a close message.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66508
---
java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
b/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
index 12ee14835f..3cae80d730 100644
--- a/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
+++ b/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java
@@ -173,6 +173,8 @@ public class WsHttpUpgradeHandler implements
InternalHttpUpgradeHandler {
}
break;
case ERROR:
+ // Need to clear any in-progress writes before trying to send
a close frame
+ wsRemoteEndpointServer.clearHandler(socketWrapper.getError(),
false);
String msg = sm.getString("wsHttpUpgradeHandler.closeOnError");
wsSession.doClose(new CloseReason(CloseCodes.GOING_AWAY, msg),
new CloseReason(CloseCodes.CLOSED_ABNORMALLY, msg));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]