Skip to content

Conversation

@lachlan-roberts
Copy link
Contributor

Closes #13290

This reduces the number of times we do a ByteBuffer.slice() when sending a frame in WebSocket, now the buffer of the Frame is consumed after the call to CoreSession.sendFrame.

Currently this PR has the potential to impact users of Jetty / Jakarta WebSocket, as now the ByteBuffers sent with the sendBinary methods will consume the buffer.

But the Jakarta API now does specify that the container should consume the ByteBuffer (see discussion on jakartaee/websocket#209).

Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, beside the 2 simplifications.

@lachlan-roberts lachlan-roberts moved this to 👀 In review in Jetty 12.1.4 Oct 20, 2025
@lachlan-roberts lachlan-roberts merged commit dfe4abe into jetty-12.1.x Oct 27, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Jetty 12.1.4 Oct 27, 2025
@lachlan-roberts lachlan-roberts deleted the fix/jetty-12.1.x/13290/websocket-consume-buffers-sendFrame branch October 27, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Consider changing 12.1 websocket-core to consume frame buffers on sendFrame

3 participants