You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by xi...@apache.org on 2021/09/30 02:53:24 UTC

[incubator-shenyu] branch master updated: [ISSUE #2173] fix websocket send message unsafe (#2174)

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

xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new c852ed5  [ISSUE #2173] fix websocket send message unsafe (#2174)
c852ed5 is described below

commit c852ed5d38d9656c1bf8a34b36121f3dd8127373
Author: sunrui849 <ru...@outlook.com>
AuthorDate: Thu Sep 30 10:53:20 2021 +0800

    [ISSUE #2173] fix websocket send message unsafe (#2174)
    
    * fix websocket not safe
    
    * fix websocket not safe
    
    Co-authored-by: rui_849217@163.com <su...@jd.com>
---
 .../org/apache/shenyu/admin/listener/websocket/WebsocketCollector.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/websocket/WebsocketCollector.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/websocket/WebsocketCollector.java
index ef9c5a1..189b78e 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/websocket/WebsocketCollector.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/websocket/WebsocketCollector.java
@@ -136,7 +136,7 @@ public class WebsocketCollector {
         }
     }
 
-    private static void sendMessageBySession(final Session session, final String message) {
+    private static synchronized void sendMessageBySession(final Session session, final String message) {
         try {
             session.getBasicRemote().sendText(message);
         } catch (IOException e) {