Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5959023

Browse filesBrowse files
addaleaxtargos
authored andcommitted
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 <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
1 parent dcdb96c commit 5959023
Copy full SHA for 5959023

File tree

Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Collapse file

‎lib/internal/http2/core.js‎

Copy file name to clipboardExpand all lines: lib/internal/http2/core.js
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,14 +2174,11 @@ function processHeaders(oldHeaders) {
21742174
return headers;
21752175
}
21762176

2177-
function onFileCloseError(stream, err) {
2178-
stream.emit(err);
2179-
}
21802177

21812178
function onFileUnpipe() {
21822179
const stream = this.sink[kOwner];
21832180
if (stream.ownsFd)
2184-
this.source.close().catch(onFileCloseError.bind(stream));
2181+
this.source.close().catch(stream.destroy.bind(stream));
21852182
else
21862183
this.source.releaseFD();
21872184
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.