Repository navigation
fix(qmux): bound WebSocket record advertisements - #498
Conversation
Quest-Claim: b05980dd2071c989
Clamp session record limits to the configured WebSocket frame and message bounds before establishment. Accept the same WebSocketConfig on the server and reject limits below the QMux minimum locally. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
|
Design change: apply record-size clamping and the minimum check after WebSocket subprotocol negotiation, only for record-framed drafts (QMux01+), before a QMux session can send transport parameters. The local review found that checking before negotiation rejected previously valid QMux00 and legacy sessions whose record-size setting is ignored. Compatibility regressions now exercise both builders on those versions with small WebSocket limits and (Written by GPT-6.1 Sol with xhigh) |
Apply record-limit validation after negotiating a record-framed draft, before a QMux session can advertise parameters. Keep QMux00 and legacy setup compatible when the configured record limit is ignored. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
|
Review response: the local review suggested filtering QMux01/02 out of negotiation when a configured record limit is too small. The approved quest Plan explicitly chooses a local connect/accept error for that configuration. I am preserving that behavior and the configured subprotocol policy, with a WebSocket Close that explains the local error before any QMux parameters are sent. The older bare-frame versions retain their existing configuration behavior, and their separate frame-size responsibility is now documented on both builders and in the README. (Written by GPT-6.1 Sol with xhigh) |
Send a WebSocket Close before returning a local record-limit error and document the caller's frame-size responsibility for older wire formats. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…rd-size # Conflicts: # rs/qmux/README.md # rs/qmux/src/ws.rs
|
Merge summary:
(Written by Claude Opus 5.5) |
QMux could advertise a 32,764-byte record limit while tungstenite rejected a 16,383-byte frame. Both WebSocket builders now clamp the QMux01+ receive record size to their frame and message limits after subprotocol negotiation and before creating a session, so the wire advertisement and receive path use the same effective bound.
ws::Server::with_config(WebSocketConfig)applies the same socket configuration API as the client.The regressions inspect actual QMux01/02 transport parameters from both builders, cover default/custom/unlimited WebSocket limits and datagram bounds, deliver exact-limit records (including fragmented messages), and verify local errors below the protocol minimum without advertising invalid parameters, and preserve QMux00/legacy setup with ignored record limits. The completed quest and its parent link are removed.
API and wire compatibility
ws::Server::with_config; no existing signatures or wire formats change.Error::TransportParameterafter WebSocket negotiation, before QMux parameters are sent, after sending a WebSocket Close explaining the configuration error. Bare-frame versions continue to ignore record limits.ws::Upgradedremains the caller's responsibility because its generic socket does not expose receive limits.Decisions
Error::TransportParameterfor invalid local record limits rather than adding another public error variant.Validation
Capacity.nix develop --command just fixpassed.nix develop --command just testpassed, including all four new regressions.nix develop --command cargo test -p qmux --no-default-features --features ws --libpassed: 142 tests.nix develop --command just checkpassed on this branch and unchanged main.check --base origin/mainpassed: 41 documents.nix develop --command cargo test -p qmux --no-default-features --features wsfails identically here and on unchanged main7cc85bd28dabca12e9a7330cddc525d884066758:rs/qmux/tests/stats.rs:3unconditionally importstransport::Stream, which requirestcpor Unixuds. The repository harness is unchanged.Review
Claude Code,
claude-opus-5-5, medium effort, round 2 of the revised design session reviewed head94c66d73e89db684d474af2c70a97647a748ea77againstorigin/main. No findings remain.--newwith--responses; the required new design session ran with--new, and the next round accepted the written finding responses.Suggested follow-up
Gate the byte-stream stats integration test on its transport features so the standalone WebSocket integration suite compiles. This existing test-feature mismatch is outside the record-size fix.
(Written by GPT-6.1 Sol with xhigh)