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

Commit 61a98e6

Browse files
pimterryaduh95
authored andcommitted
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 8929730 commit 61a98e6

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
@@ -625,7 +625,7 @@ const kMaxBatchChunks = 16;
625625
const kDefaultMaxBatchBytes = 65536;
626626

627627
async function* createBlobReaderIterable(reader, options = kEmptyObject) {
628-
const { getReadError, maxBatchBytes = kDefaultMaxBatchBytes } = options;
628+
const { maxBatchBytes = kDefaultMaxBatchBytes } = options;
629629
let wakeup = PromiseWithResolvers();
630630
let immediate;
631631
reader.setWakeup(() => {
@@ -658,9 +658,7 @@ async function* createBlobReaderIterable(reader, options = kEmptyObject) {
658658
break;
659659
}
660660
if (pullResult.status < 0) {
661-
error = typeof getReadError === 'function' ?
662-
getReadError(pullResult.status) :
663-
new ERR_INVALID_STATE('The reader is not readable');
661+
error = new ERR_INVALID_STATE('The reader is not readable');
664662
break;
665663
}
666664
if (pullResult.status === 2) {

‎lib/internal/errors.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,8 +1715,6 @@ E('ERR_QUIC_CONNECTION_FAILED', 'QUIC connection failed', Error);
17151715
E('ERR_QUIC_ENDPOINT_CLOSED', 'QUIC endpoint closed: %s (%d)', Error);
17161716
E('ERR_QUIC_OPEN_STREAM_FAILED', 'Failed to open QUIC stream', Error);
17171717
E('ERR_QUIC_STREAM_ABORTED', '%s', Error);
1718-
E('ERR_QUIC_STREAM_RESET',
1719-
'The QUIC stream was reset by the peer with error code %d', Error);
17201718
E('ERR_QUIC_VERSION_NEGOTIATION_ERROR', 'The QUIC session requires version negotiation', Error);
17211719
E('ERR_REQUIRE_ASYNC_MODULE', function(filename, parent, locations) {
17221720
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)