Skip to content

Commit

Permalink
Merge pull request #11084 from jetty/jetty-10.0.x-11081-websocketRace
Browse files Browse the repository at this point in the history
Issue #11081 - fix race condition in WebSocket FrameHandlers
  • Loading branch information
lachlan-roberts authored Dec 20, 2023
2 parents c91e3fb + e69f1d2 commit 1fb3f31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,10 @@ private void acceptMessage(Frame frame, Callback callback)
}

// 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,10 @@ private void acceptMessage(Frame frame, Callback callback)
}

// 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)
Expand Down

0 comments on commit 1fb3f31

Please sign in to comment.