Issue #11081 - fix race condition in WebSocket FrameHandlers

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2023-12-19 20:20:49 +11:00
parent f82844e2a2
commit e69f1d2bef
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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)