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 7c06eab

Browse filesBrowse files
authored
Revert "http: do not leak error listeners"
This reverts commit 736a7d8. The patch attempted to fix an issue, signaled by a warning, caused by an invalid API usage. However it introduced a behavior change that is breaking userland modules. It is a user error, so restore the original behavior and have the user investigate and fix the issue in their code. Refs: #43587 (comment) Refs: #43587 (comment) PR-URL: #44921 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im>
1 parent 3fdf6cf commit 7c06eab
Copy full SHA for 7c06eab

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

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

‎lib/_http_server.js‎

Copy file name to clipboardExpand all lines: lib/_http_server.js
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,10 +809,7 @@ const requestHeaderFieldsTooLargeResponse = Buffer.from(
809809
function socketOnError(e) {
810810
// Ignore further errors
811811
this.removeListener('error', socketOnError);
812-
813-
if (this.listenerCount('error') === 0) {
814-
this.on('error', noop);
815-
}
812+
this.on('error', noop);
816813

817814
if (!this.server.emit('clientError', e, this)) {
818815
// Caution must be taken to avoid corrupting the remote peer.
Collapse file

‎test/parallel/test-http-socket-listeners.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-socket-listeners.js
-44Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

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