This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new e5fc87e465 Further fix for BZ 66508
e5fc87e465 is described below

commit e5fc87e46561684bb04432b92e32b855b7bcbbfa
Author: Mark Thomas <ma...@apache.org>
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 f3891e1a68..b180e52a74 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: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to