Skip to content

Commit

Permalink
http2: destroy() stream, upon errnoException
Browse files Browse the repository at this point in the history
First steps towards #19060

Backport-PR-URL: #20456
PR-URL: #19389
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
SirR4T authored and MylesBorins committed May 2, 2018
1 parent 9c7bf7f commit 519b063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,7 @@ class Http2Stream extends Duplex {
req.async = false;
const err = createWriteReq(req, handle, data, encoding);
if (err)
throw util._errnoException(err, 'write', req.error);
return this.destroy(util._errnoException(err, 'write', req.error), cb);
trackWriteState(this, req.bytes);
}

Expand Down Expand Up @@ -1690,7 +1690,7 @@ class Http2Stream extends Duplex {
}
const err = handle.writev(req, chunks);
if (err)
throw util._errnoException(err, 'write', req.error);
return this.destroy(util._errnoException(err, 'write', req.error), cb);
trackWriteState(this, req.bytes);
}

Expand Down

0 comments on commit 519b063

Please sign in to comment.