Skip to content

Commit

Permalink
stream: fix premature pipeline end
Browse files Browse the repository at this point in the history
Fixes: #48406
  • Loading branch information
ronag committed Jun 12, 2023
1 parent 8244e6c commit b208392
Show file tree
Hide file tree
Showing 2 changed files with 1,632 additions and 1,604 deletions.
4 changes: 2 additions & 2 deletions lib/internal/streams/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const {
isTransformStream,
isWebStream,
isReadableStream,
isReadableEnded,
isReadableFinished,
} = require('internal/streams/utils');
const { AbortController } = require('internal/abort_controller');

Expand Down Expand Up @@ -424,7 +424,7 @@ function pipe(src, dst, finish, { end }) {
dst.end();
}

if (isReadableEnded(src)) { // End the destination if the source has already ended.
if (isReadableFinished(src)) { // End the destination if the source has already ended.
process.nextTick(endFn);
} else {
src.once('end', endFn);
Expand Down
Loading

0 comments on commit b208392

Please sign in to comment.