Skip to content

Commit d29b805

Browse files
renatomariscalBethGriggs
authored andcommitted
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: #34472 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent b261895 commit d29b805

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/api/http.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,8 @@ passed as the second parameter to the [`'request'`][] event.
13351335
added: v0.6.7
13361336
-->
13371337

1338-
Indicates that the underlying connection was terminated.
1338+
Indicates that the the response is completed, or its underlying connection was
1339+
terminated prematurely (before the response completion).
13391340

13401341
### Event: `'finish'`
13411342
<!-- YAML

0 commit comments

Comments
 (0)