Skip to content
Browse files

http2: fix file close error condition at respondWithFd

Closing a FileHandle almost never fails, so it was hard to
notice before that `stream.emit(err)` would not emit an error
event due to the missing event name.

Destroying the stream with the error seems like the right thing
to do in that scenario.

PR-URL: #29884
Reviewed-By: Colin Ihrig <>
Reviewed-By: Ruben Bridgewater <>
Reviewed-By: Anto Aravinth <>
Reviewed-By: David Carlier <>
Reviewed-By: Yongsheng Zhang <>
Reviewed-By: Luigi Pinca <>
Reviewed-By: Minwoo Jung <>
Reviewed-By: James M Snell <>
Reviewed-By: Gus Caplan <>
  • Loading branch information
addaleax authored and targos committed Oct 8, 2019
1 parent dcdb96c commit 5959023b7661985254023d4e793806aa9416824e
Showing with 1 addition and 4 deletions.
  1. +1 −4 lib/internal/http2/core.js
@@ -2174,14 +2174,11 @@ function processHeaders(oldHeaders) {
return headers;

function onFileCloseError(stream, err) {

function onFileUnpipe() {
const stream = this.sink[kOwner];
if (stream.ownsFd)

0 comments on commit 5959023

Please sign in to comment.
You can’t perform that action at this time.