Skip to content

Commit

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

PR-URL: nodejs#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 kjin committed May 1, 2018
1 parent 3ba1beb commit d932237
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 d932237

Please sign in to comment.