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 15, 2018
1 parent 83d8ad3 commit eddf3a6
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 @@ -1644,7 +1644,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 @@ -1687,7 +1687,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 eddf3a6

Please sign in to comment.