Skip to content

Fix Cxx WebSocket write queue state - #58201

Open
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-cxx-websocket-write-state
Open

Fix Cxx WebSocket write queue state#58201
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-cxx-websocket-write-state

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

The Cxx WebSocket client can write before its handshake, drop queued pre-connect and empty frames, allow concurrent Beast writes through a check-then-set race, and retain writer ownership after errors. Gate draining on a successful connection, atomically claim the single writer, preserve empty frames, and release state on every completion.

Fixes #58200.

Changelog:

[GENERAL] [FIXED] - Preserve buffered and empty Cxx WebSocket frames and serialize writes.

Test Plan:

  • Exact temporary localhost Boost server harness on untouched main: Operation canceled, both expected frames missing, exit 1.
  • Fixed source harness: received the pre-connect buffered payload and empty frame, exit 0.
  • Actual source and harness compiled under C++20 with -Wall -Werror; only a local third-party Boost/Clang deprecation was demoted.
  • Repository clang-format and git diff --check passed.
  • Temporary harness/build wiring was removed; this PR contains one runtime file only.

No UI change; screenshots are not applicable.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cxx WebSocket write queue drops pre-connect and empty frames

1 participant