Skip to content

Complete owned WebSocket shutdown and retain partial received bytes - #264

Merged
relh merged 1 commit into
masterfrom
relh/owned-websocket-close
Oct 21, 2026
Merged

relh merged 1 commit into
masterfrom
relh/owned-websocket-close

Conversation

@relh

@relh relh commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Native players can release their socket without sending or receiving a WebSocket close frame. Complete-message capture also loses partial bytes when STOP interrupts a frame.

Adds finishNativeWebSocket, which completes the close handshake within the caller's existing cleanup deadline and releases the socket on every path. EOF without a peer close frame fails; a silent peer reaches the original deadline. An optional receive observer records raw chunks before buffering, including incomplete frames and upgrade bytes. It runs synchronously on the receive owner and must not reenter IO.

Validation: Nim 2.2.4; 33 actual TCP/TLS transport scenarios passed, including partial-frame TERM/INT, close acknowledgement, abrupt EOF, silent peer, concurrent sends, fragmented messages and certificate/hostname rejection. Existing TLS fixture assertions now check the client rejection outcome without requiring one server-side EOF/reset behavior. Builds/tests ran under 2 GiB, one CPU and no swap.

Commands: nim c --parallelBuild:1 --path:src --out:/private/probe tests/support/native_websocket_probe.nim, then python tests/test_native_websocket.py /private/probe, with the locked libcurl source. This supports the remaining Notsus lifecycle fix in Crewrift #178; it does not claim that game's full qualification is complete.

Co-authored-by: GPT-6 Codex <noreply@openai.com>
@relh
relh merged commit c55afd5 into master Oct 21, 2026
2 checks passed
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.

1 participant