Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: refactor Socket._getpeername and Socket._getsockname #32969

Closed
wants to merge 5 commits into from

Conversation

himself65
Copy link
Member

Refs:

sockaddr_storage storage;
int addrlen = sizeof(storage);
sockaddr* const addr = reinterpret_cast<sockaddr*>(&storage);
const int err = F(&wrap->handle_, addr, &addrlen);
if (err == 0)
AddressToJS(wrap->env(), addr, args[0].As<v8::Object>());
args.GetReturnValue().Set(err);

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the net Issues and PRs related to the net subsystem. label Apr 21, 2020
lib/net.js Outdated Show resolved Hide resolved
lib/net.js Outdated Show resolved Hide resolved
lib/net.js Outdated Show resolved Hide resolved
@nodejs-github-bot
Copy link
Collaborator

@BridgeAR BridgeAR requested a review from bnoordhuis May 24, 2020 14:35
@nodejs-github-bot
Copy link
Collaborator

if (!this._handle || !this._handle.getpeername) {
return this._peername || {};
} else if (!this._peername) {
this._peername = {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a functional change in that before errors can be transient, i.e., the first call can return an empty object while the second call can return a full-fledged address object. Now errors are no longer transient because the empty object is cached.

It's a probably inconsequential change in behavior but I'd label it semver-major anyway.

lib/net.js Outdated Show resolved Hide resolved
himself65 and others added 2 commits May 29, 2020 17:43
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
@nodejs-github-bot
Copy link
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/31623/

@himself65 himself65 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 30, 2020
@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label May 31, 2020
@jasnell
Copy link
Member

jasnell commented May 31, 2020

Marking semver-major per #32969 (comment)

@BridgeAR BridgeAR force-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72 Compare May 31, 2020 12:18
@jasnell
Copy link
Member

jasnell commented Jun 19, 2020

@nodejs/tsc ... since this is semver-major we need another TSC signoff

@jasnell jasnell removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 24, 2020
@jasnell
Copy link
Member

jasnell commented Jun 24, 2020

Removed the author ready because this needs at least one more tsc signoff in order to land

@himself65 himself65 requested a review from a team as a code owner August 10, 2020 16:07
@himself65 himself65 requested a review from a team August 10, 2020 16:07
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 16, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 16, 2020
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@github-actions github-actions bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Oct 17, 2020
@github-actions
Copy link
Contributor

Commit Queue failed
- Loading data for nodejs/node/pull/32969
✔  Done loading data for nodejs/node/pull/32969
----------------------------------- PR info ------------------------------------
Title      lib: refactor Socket._getpeername and Socket._getsockname (#32969)
Author     Himself65  (@Himself65)
Branch     Himself65:20200421-address -> nodejs:master
Labels     author ready, net, semver-major
Commits    5
 - lib: refactor Socket._getpeername and Socket._getsockname
 - fixup!
 - fixup! backport
 - fixup!
 - fixup! edit comment
Committers 2
 - himself65 
 - GitHub 
PR-URL: https://github.com/nodejs/node/pull/32969
Refs: https://github.com/nodejs/node/blob/7893c70970adfbefb1684c48d42aff7385a2afb8/src/node_internals.h#L79-L85
Reviewed-By: James M Snell 
Reviewed-By: Ben Noordhuis 
Reviewed-By: Matteo Collina 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/32969
Refs: https://github.com/nodejs/node/blob/7893c70970adfbefb1684c48d42aff7385a2afb8/src/node_internals.h#L79-L85
Reviewed-By: James M Snell 
Reviewed-By: Ben Noordhuis 
Reviewed-By: Matteo Collina 
--------------------------------------------------------------------------------
   ✔  Last GitHub Actions successful
   ℹ  Last Full PR CI on 2020-10-16T23:28:31Z: https://ci.nodejs.org/job/node-test-pull-request/33684/
- Querying data for job/node-test-pull-request/33684/
✔  Build data downloaded
- Querying failures of job/node-test-commit/41438/
✔  Data downloaded
   ✖  2 failure(s) on the last Jenkins CI run
   ℹ  This PR was created on Tue, 21 Apr 2020 12:04:10 GMT
   ✔  Approvals: 3
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/32969#pullrequestreview-417884204
   ✔  - Ben Noordhuis (@bnoordhuis): https://github.com/nodejs/node/pull/32969#pullrequestreview-418200196
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/32969#pullrequestreview-464801397
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu

Commit Queue action: https://github.com/nodejs/node/actions/runs/311694300

@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Oct 19, 2020

Landed in 1428db8

@aduh95 aduh95 closed this Oct 19, 2020
aduh95 pushed a commit that referenced this pull request Oct 19, 2020
PR-URL: #32969
Refs: https://github.com/nodejs/node/blob/7893c70970adfbefb1684c48d42aff7385a2afb8/src/node_internals.h#L79-L85
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
@targos targos removed the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. net Issues and PRs related to the net subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants