From 226668f33ca4e5103864f45309f8adba32f6d6e3 Mon Sep 17 00:00:00 2001 From: Ji Hoon Kang Date: Sat, 1 Aug 2026 09:09:08 +0900 Subject: [PATCH 1/2] doc: document quic stopSending() and resetStream() `QuicStream` exposes `stopSending()` and `resetStream()`, but neither appeared in the QuicStream API reference. Both matter when half-closing a stream, which protocols such as WebTransport rely on. Document the two methods and list them in the "Aborting a stream" summary, which previously covered only `writer.fail()` and `stream.destroy()`. Unlike those, both send the given code as-is rather than deriving a wire code from an error. Fixes: https://github.com/nodejs/node/issues/63680 Signed-off-by: Ji Hoon Kang --- doc/api/quic.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index 1a592d85945d..a174527872aa 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1923,9 +1923,14 @@ True if `stream.destroy()` has been called. ### Aborting a stream -A QuicStream can be aborted in three ways, each producing different +A QuicStream can be aborted in several ways, each producing different wire-frame side effects: +* [`stream.stopSending()`][] — Aborts only the readable side. Sends + `STOP_SENDING` to the peer. The writable side is unaffected. +* [`stream.resetStream()`][] — Aborts only the writable side. Sends + `RESET_STREAM` to the peer. Unlike [`writer.fail(reason)`][], the wire + code is given directly rather than derived from an error. * [`writer.fail(reason)`][] — Aborts only the writable side. Sends `RESET_STREAM` to the peer. The readable side is unaffected; any data already buffered for read remains available. @@ -1943,6 +1948,41 @@ the wire code for both `writer.fail()` and `stream.destroy()`. Otherwise the implementation falls back to the negotiated application protocol's "internal error" code (see [`QuicError`][]). +[`stream.stopSending()`][] and [`stream.resetStream()`][] do +not perform this derivation: they send `code` as given. + +### `stream.resetStream([code])` + + + +* `code` {number|bigint} The application error code to send to the peer. + **Default:** `0n`. + +Tells the peer that this end will not send any more data on this stream, +sending a `RESET_STREAM` frame carrying `code`. The readable side is left +open, so data already sent by the peer remains available to read. + +No acknowledgement of this action is provided. Has no effect if the stream +has been destroyed. + +### `stream.stopSending([code])` + + + +* `code` {number|bigint} The application error code to send to the peer. + **Default:** `0n`. + +Asks the peer to stop sending data on this stream, sending a `STOP_SENDING` +frame carrying `code`. The writable side is left open, so this end can +still send data. + +No acknowledgement of this action is provided. Has no effect if the stream +has been destroyed. + ### `stream.early`