FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: update http server response 'close' event by renatomariscal · Pull Request #34472 · nodejs/node · GitHub

/ node Public

doc: update http server response 'close' event - #34472

Closed
renatomariscal wants to merge 1 commit into
nodejs:masterfrom
renatomariscal:renato/documentation
Closed

doc: update http server response 'close' event#34472
renatomariscal wants to merge 1 commit into
nodejs:masterfrom
renatomariscal:renato/documentation

Conversation

Copy link
Copy Markdown
Contributor

Two places emits close events:

1 - On result completion:

resOnFinish calls emitCloseNT, which happens when the result is completed:

function resOnFinish(req, res, socket, state, server) {

2 - When the connection is terminated

It gets attached once the socket is assigned:

socket.on('close', onServerResponseClose);

And detached if the response is completed:
https://github.com/nodejs/node/blob/master/lib/_http_server.js#L709

ServerResponse.prototype.detachSocket = function detachSocket(socket) {

Which means, it can only be reached in this case, for premature socket termination.

Checklist

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.
nodejs-github-bot added doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. labels Jul 22, 2020

Trott commented Jul 23, 2020

Copy link
Copy Markdown
Member

@nodejs/http @addaleax @ronag

renatomariscal requested a review from a team as a code owner August 10, 2020 16:06
Trott pushed a commit that referenced this pull request Aug 11, 2020
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 <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

Trott commented Aug 11, 2020

Copy link
Copy Markdown
Member

Landed in f8a0e62
Thanks for the contribution! 🎉

Trott closed this Aug 11, 2020
MylesBorins pushed a commit that referenced this pull request Aug 17, 2020
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 <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams mentioned this pull request Aug 20, 2020
BethGriggs pushed a commit that referenced this pull request Aug 20, 2020
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 <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
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 <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
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 <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere mentioned this pull request Sep 28, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL