X Tutup
The Wayback Machine - https://web.archive.org/web/20220423135748/https://github.com/nodejs/node/pull/32969
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

Copy link
Member

@Himself65 Himself65 commented Apr 21, 2020

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 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
Contributor

@nodejs-github-bot nodejs-github-bot commented May 24, 2020

@BridgeAR BridgeAR requested a review from bnoordhuis May 24, 2020
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented May 24, 2020

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

@bnoordhuis bnoordhuis May 26, 2020

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
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented May 29, 2020

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

@Himself65 Himself65 added the author ready label May 30, 2020
@jasnell jasnell added the semver-major label May 31, 2020
@jasnell
Copy link
Member

@jasnell 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
@jasnell
Copy link
Member

@jasnell jasnell commented Jun 19, 2020

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

@jasnell jasnell removed the author ready label Jun 24, 2020
@jasnell
Copy link
Member

@jasnell 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 review from as code owners Aug 10, 2020
Copy link
Member

@mcollina mcollina left a comment

lgtm

@aduh95 aduh95 added author ready commit-queue request-ci labels Oct 16, 2020
@github-actions github-actions bot removed the request-ci 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 and removed commit-queue labels Oct 17, 2020
@github-actions
Copy link

@github-actions github-actions bot commented Oct 17, 2020

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
Contributor

@nodejs-github-bot nodejs-github-bot commented Oct 19, 2020

@aduh95
Copy link
Contributor

@aduh95 aduh95 commented Oct 19, 2020

Landed in 1428db8

@aduh95 aduh95 closed this Oct 19, 2020
aduh95 pushed a commit that referenced this issue 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 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 net semver-major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants
X Tutup