Skip to content

Commit

Permalink
wip: fix for nodejs#37224
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Apr 21, 2021
1 parent 8ee5bbe commit a4507e0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/internal/stream_base_commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@ function onStreamRead(arrayBuffer) {
}

if (nread !== UV_EOF) {
// TODO(ronag): Without this `readStop`, `onStreamRead`
// will be called once more (i.e. after Readable.ended)
// on Windows causing a ECONNRESET, failing the
// test-https-truncate test.
if (handle.readStop) {
const err = handle.readStop();
if (err) {
stream.emit('error', err);
}
}
// CallJSOnreadMethod expects the return value to be a buffer.
// Ref: https://github.com/nodejs/node/pull/34375
stream.destroy(errnoException(nread, 'read'));
Expand Down

0 comments on commit a4507e0

Please sign in to comment.