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

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 targos committed Apr 2, 2018
1 parent dac5f67 commit 7b850a7
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 @@ -1646,7 +1646,7 @@ class Http2Stream extends Duplex {
req.async = false;
const err = createWriteReq(req, handle, data, encoding);
if (err)
throw errors.errnoException(err, 'write', req.error);
return this.destroy(errors.errnoException(err, 'write', req.error), cb);
trackWriteState(this, req.bytes);
}

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

Expand Down

0 comments on commit 7b850a7

Please sign in to comment.