Skip to content

Conversation

addaleax
Copy link
Member

Fixes: #11954
Refs: #11961

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

@addaleax addaleax added dgram Issues and PRs related to the dgram subsystem / UDP. semver-major PRs that contain breaking changes and should be released in the next major version. labels Mar 22, 2017
@addaleax addaleax requested a review from TimothyGu March 22, 2017 07:07
@nodejs-github-bot nodejs-github-bot added the dgram Issues and PRs related to the dgram subsystem / UDP. label Mar 22, 2017
lib/dgram.js Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Since the error message is changing anyway, can you s/buffer/Buffer here to make it consistent with the other error messages thrown in this module?

Copy link
Member Author

Choose a reason for hiding this comment

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

@jasnell Right, done!

@addaleax
Copy link
Member Author

const port = client.address().port;
client.send(toSend[0], 0, toSend[0].length, port);
client.send(toSend[1], port);
client.send(new Uint8Array([...toSend[1]]), port);
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 missing test cases for socket.send(u8a, offset, length, port) and socket.send(buffer, port).

Also, is new Uint8Array([...toSend[1]]) here the same as new Uint8Array(toSend[1])?

Copy link
Member Author

Choose a reason for hiding this comment

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

@joyeecheung Right, thanks for pointing that out. I’ve updated the file so all the tests are run twice now, once with the original input types and once with Uint8Arrays.

@addaleax
Copy link
Member Author

Landed in 2dc1053

@addaleax addaleax closed this Mar 27, 2017
@addaleax addaleax deleted the dgram-uint8array branch March 27, 2017 00:08
addaleax added a commit that referenced this pull request Mar 27, 2017
Fixes: #11954
Refs: #11961
PR-URL: #11985
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
@jasnell jasnell mentioned this pull request Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dgram Issues and PRs related to the dgram subsystem / UDP. 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.

Buffer::Length hard crashes

7 participants