quic: fix readable stream truncation on stop-sending, abort & timeout · nodejs/node@11ed325 · GitHub
Skip to content

Commit 11ed325

Browse files
authored
quic: fix readable stream truncation on stop-sending, abort & timeout
Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: #63967 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 26dbe11 commit 11ed325

14 files changed

Lines changed: 556 additions & 178 deletions

‎doc/api/quic.md‎

Lines changed: 24 additions & 0 deletions

‎lib/internal/blob.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ const kMaxBatchChunks = 16;
631631
const kDefaultMaxBatchBytes = 65536;
632632

633633
async function* createBlobReaderIterable(reader, options = kEmptyObject) {
634-
const { getReadError, maxBatchBytes = kDefaultMaxBatchBytes } = options;
634+
const { maxBatchBytes = kDefaultMaxBatchBytes } = options;
635635
let wakeup = PromiseWithResolvers();
636636
let immediate;
637637
reader.setWakeup(() => {
@@ -664,9 +664,7 @@ async function* createBlobReaderIterable(reader, options = kEmptyObject) {
664664
break;
665665
}
666666
if (pullResult.status < 0) {
667-
error = typeof getReadError === 'function' ?
668-
getReadError(pullResult.status) :
669-
new ERR_INVALID_STATE('The reader is not readable');
667+
error = new ERR_INVALID_STATE('The reader is not readable');
670668
break;
671669
}
672670
if (pullResult.status === 2) {

‎lib/internal/errors.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,8 +1718,6 @@ E('ERR_QUIC_CONNECTION_FAILED', 'QUIC connection failed', Error);
17181718
E('ERR_QUIC_ENDPOINT_CLOSED', 'QUIC endpoint closed: %s (%d)', Error);
17191719
E('ERR_QUIC_OPEN_STREAM_FAILED', 'Failed to open QUIC stream', Error);
17201720
E('ERR_QUIC_STREAM_ABORTED', '%s', Error);
1721-
E('ERR_QUIC_STREAM_RESET',
1722-
'The QUIC stream was reset by the peer with error code %d', Error);
17231721
E('ERR_QUIC_VERSION_NEGOTIATION_ERROR', 'The QUIC session requires version negotiation', Error);
17241722
E('ERR_REQUIRE_ASYNC_MODULE', function(filename, parent, locations) {
17251723
let message = 'require() cannot be used on an ESM graph with top-level await. Use import() instead.';

‎lib/internal/quic/quic.js‎

Lines changed: 87 additions & 43 deletions

0 commit comments

Comments
 (0)