diff options
author | Renato Mariscal <renatomariscal@users.noreply.github.com> | 2020-07-22 02:28:33 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-08-11 03:52:32 +0300 |
commit | f8a0e62bbf4a9ad6a526bc7d26bdb77132be994a (patch) | |
tree | b6ca9b0619677e2fd7e3e88f91c86344f2061a5a /doc/api/http.md | |
parent | ea5eb8fc9cf137350862a046cc4f05c2f29300db (diff) |
doc: update http server response 'close' event
Two places emits `close` events:
`resOnFinish` calls `emitCloseNT`, which happens when the result is
completed:
https://github.com/nodejs/node/blob/687dbd85263f433cc351c6daa83f9296a1d0bb4f/lib/_http_server.js#L695
It gets attached once the socket is assigned:
https://github.com/nodejs/node/blob/687dbd85263f433cc351c6daa83f9296a1d0bb4f/lib/_http_server.js#L226
And detached if the response is completed:
https://github.com/nodejs/node/blob/master/lib/_http_server.js#L709
https://github.com/nodejs/node/blob/687dbd85263f433cc351c6daa83f9296a1d0bb4f/lib/_http_server.js#L232
Which means, it can only be reached in this case, for premature socket
termination.
PR-URL: https://github.com/nodejs/node/pull/34472
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc/api/http.md')
-rw-r--r-- | doc/api/http.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/http.md b/doc/api/http.md index 2475f94420b..e5871ef5a8c 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1338,7 +1338,8 @@ passed as the second parameter to the [`'request'`][] event. added: v0.6.7 --> -Indicates that the underlying connection was terminated. +Indicates that the the response is completed, or its underlying connection was +terminated prematurely (before the response completion). ### Event: `'finish'` <!-- YAML |