lib,src: add unix socket getsockname/getpeername#956
Conversation
|
LGTM |
|
I think @rvagg aborted my CI trial run. Here's another: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/201/ |
|
Sorry if I did, quite possible. I also just aborted the armv6 part of that cause I need it for release but I doubt that would have been interesting anyway. |
|
And of course VS 2013 chokes on the template function... The day we ditch VS for clang can not come quickly enough! Pushed a fix and started a new CI run, PTAL. /cc @piscisaureus https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/203/ |
|
@rvagg could we re-run the tests on the windows machines (assuming we know they now give us proper test feedback)? |
|
+1, I think this is a big improvement in the API, but:
|
|
For those wanting to see the before vs after, with Before this PR: After: Much better, but not API compatible. |
|
@bnoordhuis and that |
|
@sam-github Nope, that's just how UNIX sockets work. The client doesn't have a local address. |
|
@bnoordhuis at the system level, yes, but we could save the address we connected to and return it. Using an address object rather than a string already makes this more consistent with TCP, papering over this last thing would make it even better. |
|
@sam-github That's what |
|
@bnoordhuis TCP client sockets aren't addressable, either, but I take your point that the client But as it is, the check to see if a client is unix or TCP now is: Maybe at least the address family could be present. |
|
@sam-github Added .family property and documentation, PTAL. |
|
There are 11 failures on Windows but only 2 are related to this PR, parallel/test-http-unix-socket and sequential/test-pipe-address. Apparently the dot in the file path gets rewritten to a question mark, not sure what's up with that. @piscisaureus Is that expected behavior? From looking at libuv, the named pipe's name seems to be coming directly from NtQueryInformationFile(). |
|
@bnoordhuis |
|
Morbid fascination gets the better of me: what's the long answer? Should I just special-case it in tests or can I change common.PIPE to |
|
@bnoordhuis A way to make the test pass is to use a |
|
Alright, thanks for the answer. I'll update test/common.js. |
|
@bnoordhuis The pipe filesystem driver however is a bit different, since it does not support directories. Any pipe name is acceptable, even slashes are considered part of the file name. However due to the '..' processing in the Win32 layer, one can use the pipe filesystem as if it supported directories. That is, with the exception that there's no possibility nor need to create directories. |
|
@piscisaureus Duly noted, thanks. :-) Here's another try: https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/249/ |
|
Feature as implemented LGTM Though two things to consider: In the I think its a semver-major API change. Not a big API change, not world changing, not going to effect 99% of node code (because its all HTTP), not worth reving to 2.x tomorrow because of it... but still an API change. I worry that not calling it major means iojs isn't semvered again... its going back to "major is a BIG change", rather than "major means some of your code that previously conformed to the documented API may no longer work as it used to". |
|
Boo! Looks like |
@sam-github That seems less than optimal. The reference documentation is not a document that people normally read top to bottom, they just skip to the section they're interested in. If you explain something in the middle, they're going to miss it.
Virtual shrug. Personally, I think it's closer to a bug fix than a major change because of this (from here):
Of course it's not an empty object but the path string getting coerced to an object in code like @iojs/tc What do you think? |
PR-URL: nodejs#2424 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This poplulates the lists of flaky tests with tests that failed recently in Jenkins. PR-URL: nodejs#2424 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Refer: nodejs#1543 When this test fails, it leaves dead processes in the system. This patch makes sure that the child processes exit first, in case of errors. PR-URL: nodejs#2206 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
memset() is not useful here, it's efficiently a noop. PR-URL: nodejs#2575 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Replaced "contents is" with "contents are". Added a note that initial Buffer contents could contain sensitive data. PR-URL: nodejs#2574 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
|
CI looks good. |
Extract the common logic into a template function. No functional changes, just code cleanup. PR-URL: nodejs#956 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The implementation is a minor API change in that socket.address() now
returns a `{ address: '/path/to/socket' }` object, like it does for TCP
and UDP sockets. Before this commit, it returned `socket._pipeName`,
which is a string when present.
Change common.PIPE on Windows from '\\\\.\\pipe\\libuv-test' to
'\\\\?\\pipe\\libuv-test'. Windows converts the '.' to a '?' when
creating a named pipe, meaning that common.PIPE didn't match the
result from NtQueryInformationFile().
Fixes: nodejs#954
PR-URL: nodejs#956
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Complements the existing net.Socket#remoteFamily property. PR-URL: nodejs#956 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
|
Landed in d6714ff...7a999a1. GH got a little confused because the target branch changed from v1.x to master. |
|
@Fishrock123 @bnoordhuis Looks like the |
|
Curious. I'm unclear on why the previous run succeeded. I'm doing a new run to see if it's reproducible on master: https://jenkins-iojs.nodesource.com/job/node-test-commit/359/ |
|
@bnoordhuis That particular case failed again in both the Windows instances. |
|
I think I understand now why the previous CI run passed, it was building the wrong PR. There was a hiccup a few days ago where some runs got relabeled because of another, aborted run and I suspect I've hit that. I'll see about fixing the tests. |
|
Cool then :) |
|
Testing a hunch here. It looks like |
|
@bnoordhuis No luck :-( That test is still failing. |
|
Moving to revert, see #2584. |
The implementation is a minor API change in that socket.address() now
returns a
{ address: '/path/to/socket' }object, like it does for TCPand UDP sockets. Before this commit, it returned
socket._pipeName,which is a string when present.
Fixes: iojs#954
R=@trevnorris?
https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/195/