Skip to content

fix: honor the buffer window in every send path - #245

Merged
devopvoid merged 1 commit into
devopvoid:mainfrom
SendableMetatype:fix/send-buffer-window
Aug 11, 2026
Merged

fix: honor the buffer window in every send path#245
devopvoid merged 1 commit into
devopvoid:mainfrom
SendableMetatype:fix/send-buffer-window

Conversation

@SendableMetatype

Copy link
Copy Markdown
Contributor

RTCDataChannel.send behaves differently depending on the buffer it is handed: a heap buffer with an accessible backing array sends the entire backing array regardless of position and limit, a read only heap buffer honors the window, and a direct buffer sends the full capacity. Any caller that slices, flips, or reuses a buffer silently transmits the wrong bytes.

All paths now send exactly the bytes between position and limit, read through a duplicate so the caller's buffer state is untouched. Java only, no native changes.

@devopvoid
devopvoid merged commit 2a7449c into devopvoid:main Aug 11, 2026
16 of 19 checks passed
@SendableMetatype
SendableMetatype deleted the fix/send-buffer-window branch August 12, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants