diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java index 5ebbfa9dfef..315ccbb5330 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java @@ -596,9 +596,10 @@ public class JavaxWebSocketFrameHandler implements FrameHandler } // Accept the payload into the message sink - activeMessageSink.accept(frame, callback); + MessageSink messageSink = activeMessageSink; if (frame.isFin()) activeMessageSink = null; + messageSink.accept(frame, callback); } public void onPing(Frame frame, Callback callback) diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java index e002794c012..c882b20f4ea 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java @@ -345,9 +345,10 @@ public class JettyWebSocketFrameHandler implements FrameHandler } // Accept the payload into the message sink - activeMessageSink.accept(frame, callback); + MessageSink messageSink = activeMessageSink; if (frame.isFin()) activeMessageSink = null; + messageSink.accept(frame, callback); } private void onBinaryFrame(Frame frame, Callback callback)