io: public raw-app stream RESET_STREAM / STOP_SENDING API - #240
Merged
Conversation
Adds an embedder-facing stream-cancel API (Go transport `Reset` /
`CancelRead` / `CancelWrite`):
- Server/Client `resetRawAppStream(stream_id, code)` — send RESET_STREAM
(RFC 9000 §19.4) and drop the local send slot.
- Server/Client `stopSendingRawAppStream(stream_id, code)` — send
STOP_SENDING (§19.5); the peer replies with RESET_STREAM.
- `StopSending.serialize` (the frame only had `parse`).
- Receiver side: `RawAppStreamSlot` gains `reset_received` /
`reset_error_code`, set from both roles' RESET_STREAM handlers, and
queryable via `rawAppStreamResetReceived` (mirrors Go's
`StreamResetError{Code}` on read).
Loopback test: the server opens a raw-app stream, sends data, then
`resetRawAppStream(…, 42)`; the client observes the reset with code 42
(negative-controlled). Bumps version to 1.7.68.
ch4r10t33r
added a commit
to blockblaz/zig-ethp2p
that referenced
this pull request
Jul 5, 2026
) (#78) Bumps zquic to v1.7.68 and connects the shim's previously no-op stream cancel stubs to zquic's new raw-app reset API: - `streamCancelWrite` → RESET_STREAM (Go transport `Reset`/`CancelWrite`) - `streamCancelRead` → STOP_SENDING (Go `CancelRead`), releasing our receive obligation / flow-control credit — the peer replies RESET_STREAM - `streamResetReceived` → the peer's application error code if it reset the stream (read side of Go `StreamResetError{Code}`) Both are role-aware (client vs server) and now consume the formerly-dead `Stream.reset_how` as the application error code. The QUIC handshake tests already drive `streamCancelWrite` via `PeerConn.close`; the RESET_STREAM round-trip itself is covered by the zquic loopback test in zigstack/zquic#240. Together with the earlier `ConnectionStats` change, this lands the concrete transport-control features from the Go reference. Refs #40.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an embedder-facing stream-cancel API — the zquic half of the Go transport
Reset/CancelRead/CancelWritesurface (used to wire zig-ethp2p's shimstreamCancelWrite/streamCancelRead, currently no-ops).API
Server.resetRawAppStream(conn, stream_id, error_code)/Client.resetRawAppStream(stream_id, error_code)— send RESET_STREAM (RFC 9000 §19.4) and drop the local send slot.Server.stopSendingRawAppStream(...)/Client.stopSendingRawAppStream(...)— send STOP_SENDING (§19.5); the existing handler makes the peer reply with RESET_STREAM.StopSending.serialize— the frame previously only hadparse.Receiver side (read parity with Go
StreamResetError{Code})RawAppStreamSlotgainsreset_received/reset_error_code, set from both roles' RESET_STREAM handlers (server onconn.raw_app_streams, client onClient.raw_app_recv), and queryable viarawAppStreamResetReceived(conn, sid)/Client.rawAppStreamResetReceived(sid).Test
Loopback: server opens a raw-app stream, sends data, then
resetRawAppStream(…, 42); the client observes the reset with code 42. A negative control confirmed it reads 42 (not a stale/default value). Fullzig build testgreen. Version → 1.7.68.