You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/12/04 12:56:28 UTC

[tomcat] branch 8.5.x updated: Fix a couple of very unlikely concurrency issues writing WebSocket msgs

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 1a12467  Fix a couple of very unlikely concurrency issues writing WebSocket msgs
1a12467 is described below

commit 1a12467980de921b76284ab391bd3863c54146b5
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Dec 4 12:55:18 2019 +0000

    Fix a couple of very unlikely concurrency issues writing WebSocket msgs
---
 java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java | 4 ++--
 webapps/docs/changelog.xml                                     | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
index f022132..548f5a9 100644
--- a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
+++ b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
@@ -841,7 +841,7 @@ public abstract class WsRemoteEndpointImplBase implements RemoteEndpoint {
         private final ByteBuffer outputBuffer;
         private final boolean flushRequired;
         private final WsRemoteEndpointImplBase endpoint;
-        private int maskIndex = 0;
+        private volatile int maskIndex = 0;
 
         public OutputBufferSendHandler(SendHandler completion,
                 long blockingWriteTimeoutExpiry,
@@ -1258,7 +1258,7 @@ public abstract class WsRemoteEndpointImplBase implements RemoteEndpoint {
 
     private static class BlockingSendHandler implements SendHandler {
 
-        private SendResult sendResult = null;
+        private volatile SendResult sendResult = null;
 
         @Override
         public void onResult(SendResult result) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 129be51..572808d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -119,6 +119,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="WebSocket">
+    <changelog>
+      <fix>
+        Ensure a couple of very unlikely concurrency issues are avoided when
+        writing WebSocket messages. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Web applications">
     <changelog>
       <fix>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org