From 8799f43fb0626d4453f7ff7d9d20d4075adf7784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 14 Jul 2018 12:49:14 +0200 Subject: [PATCH] http: revert "http: always emit close on req and res" This reverts a commit that accidentally introduced a semver-major change to Node 10 and broke userland code. A subsequent fix to that change and documentation change are reverted with it. Revert "http: fix res emit close before user finish" This reverts commit 2a9c83321b7893395d9472755290c31acf4228a4. Revert "http: always emit close on req and res" This reverts commit 8029a2473e032c5006d2dfc3044bdce1b221dee4. Revert "doc: fix HTTP req/res 'close' description" This reverts commit 8ab7ea6eed76d069dfd82684e2157e7d88badebf. PR-URL: https://github.com/nodejs/node/pull/21809 Reviewed-By: Matteo Collina Reviewed-By: Myles Borins Reviewed-By: Rod Vagg Reviewed-By: Michael Dawson Reviewed-By: Anatoli Papirovski Reviewed-By: Colin Ihrig Reviewed-By: Tiancheng "Timothy" Gu --- doc/api/http.md | 4 +++- lib/_http_server.js | 6 ------ test/parallel/test-http-req-res-close.js | 25 ------------------------ 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 test/parallel/test-http-req-res-close.js diff --git a/doc/api/http.md b/doc/api/http.md index fd8bb02776d03f..e83c507bf2ee0a 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1015,7 +1015,8 @@ interface. This is an [`EventEmitter`][] with the following events: added: v0.6.7 --> -Indicates that the underlying connection was terminated. +Indicates that the underlying connection was terminated before +[`response.end()`][] was called or able to flush. ### Event: 'finish' Indicates that the underlying connection was closed. +Just like `'end'`, this event occurs only once per response. ### message.aborted