-
Notifications
You must be signed in to change notification settings - Fork 146
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
Node 0.11.x support #99
Conversation
untested.
I only took a birdseye view at the code so excuse me if I'm mistaken, but shouldn't `errno` be `err`?
errno is undefined
This PR addresses issue #83 |
Thanks for stepping up, @donpark. It is a pretty involved change set, though. I'll review it and comment in-line. @ronkorving, could you do/organize a little gang testing? |
Absolutely. I would've been rather surprised and dismayed if my 'carpet-bombing' PR got merged as-is. |
Uhu... I catch your drift. Thing is: Quite a while back I decided that I'm done with node. I'm done with it because of issues like this one. I'm fed up with the node teams attitude regarding native modules. So no, I won't fix another breakage caused by @joyent's inability or unwillingness to mitigate the consequences of their changes. I'm still trying to help people out but I won't do any active development. I'm sorry to do this but this is a spare time project and spare time should be fun. However, I will review it and then we'll go from there. If you, @donpark, don't have the time to clean up the patch maybe someone else does. |
cb(undefined, []); | ||
} else { | ||
cb(errnoException(errno, 'getaddrinfo')); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate Code: The two versions of oncomplete
are almost identical. The second version should call the first one and just inject the error argument.
NP. Felt the same frustration. I patched node_mdns for a prototype app using atomshell which saw the broadside of 0.11.x related nightmare. Yikes. But it's just a tool and this PR was requested by someone else. Let's just leave this as is for now. Anyone who needs it badly can use my fork. |
result->Set(String::New(&*key.begin()), | ||
value_ptr ? | ||
String::New(static_cast<const char*>(value_ptr), value_length) : | ||
Undefined()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My beautiful ternary operator! Gone. >:{
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha. ?:
formatting fetish is bizarrely common.
A'ight. BTW, @ronkorving: If you and the users decide to merge it as is without further testing or clean-ups: I'm good with that. |
Hey guys, thanks for the work and review. I've been traveling so I have some catching up to do left and right. I'll give this PR a pass. |
@@ -55,5 +55,10 @@ | |||
, "github": "TobyEalden" | |||
} | |||
] | |||
, "dependencies": | |||
{ "bindings": "*" | |||
, "nan": "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how @agnat feels about this, but I'm very much against asterisking dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very much against dependencies.
Both of them are tightly coupled to node. In fact they are part of node but... oh well. Pinning a version does not seem right either. We want the latest round of nan compatibility hacks, no? What do you suggest? >=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least ~
. Changing a major version allows you to break all-the-things. We don't want to be hit by that at night when we're deploying our latest product, just because it coincided with a breaking release of a dependency (NAN) of a dependency (node-mdns).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're much more experienced in actually running this kind of thing. So, it's up to you. As I said: I'm not ok with dependencies anyway. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*
was the reason the branch was named nan-latest
. It should be fixed to a version after merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tilde (or that godawful caret) is good for NAN, we only do bug fixes in patch releases and promise not to break anything there. Minor versions are mostly safe as well, but stuff can get deprecated for good reasons. Major versions can do anything.
args[1] = Integer::New(flags); | ||
args[2] = Integer::NewFromUnsigned(interfaceIndex); | ||
args[3] = Integer::New(errorCode); | ||
args[0] = NanNew(NanObjectWrapHandle(serviceRef)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be no need for the NanNew
here, NanObjectWrapHandle
returns a Local<Object>
That would be my expectation too although all service types I've seen were lowercase.
No, OS X Yosemite w/XCode 6.1. |
NanObjectWrapHandle already returns a Local<Object>.
From page 5 of Bonjour Device Discovery.pdf:
Note this is not from RFC 2782 itself but just mentioned in DNS SRV-related slide created by two Apple engineer. My theory: 1) Bonjour service type names are case insensitive and supports uppercase, but 2) DNS SRV record entry has to be lowercase, so 3) everyone used lowercase to avoid headaches. |
Re simple browsing assert failures, they fail on node_mdns version 2.2.1 also so doesn't appear to be caused by this PR. |
Found a more definite source. From Apple's MCNearbyServiceBrowser doc:
Note there are some confusions over how many hyphens are allowed. What a fine mess. |
Nice. You already found and fixed the char set. I guess newer versions just enforce lowercase service types. That would explain the test failures. All tests pass on OS X 10.9 node v0.10.32. Let's give other interested parties a couple of hours to run the tests and we're good to go. |
Thanks everybody for this great PR: @kkoopa, @ronkorving, @y-lohse and most of all @donpark who did the work and pushed mdns to the future. Great job. |
I clearly did the biggest part. Joke aside, I tested on windows this morning, works fine. The tests fail at some point but I never ran them before so it might not be related to this PR. Here's the log:
Otherwise, thanks for the great job :) |
Would you mind taking a closer look into that? Not to sound too stupid I hope, but what's an luid anyway? |
ludicrous identifier... or something. |
I knew it was something super duper technical. I'm not cut out for this. |
I was going to debug it, but don't have a Crapple ID or the necessary SDK, so screw that. Mac sucks. |
IIRC, windows interface names are subject to i18n and admins can change them. The luid is an internal identifier to keep track of things. Could be an actual bug or just another weak test, though... |
I guess luid are locally unique. They are carefully crafted to collide across systems. Think |
I'm completely clueless regarding c++, I don't even know how to log an error… so i'm afraid I won't be able to help a lot. |
LUID is a 64-bit locally unique identifier returned by Windows IP Helper API function ConvertInterfaceAliasToLuid failure of which is mapped to "failed to convert interface alias to luid" error in network_interface.cpp. This may have something to do with deprecation warning above error throwing call to dns_sd.if_nameToIndex:
|
Pretty sure the warning is unrelated. It's about an, uh, upcoming API change in node_mdns. Although the code tries to handle unicode names this never has been stress tested. So, blaming the accent seems like a good guess. |
@y-lohse, could you paste the results of |
Sure thing:
Out of curiosity, I commented the failing test out and the rest of them pass. |
Let's create a new issue for this one... |
@agnat What I meant by related was the need for deprecation warning which points to changing environment, new code, and so on. Sorry, I tend to go meta at wrong times. |
With these changes, node_mdns builds and runs under Node 0.11.14 and nan 1.3 although I cannot say with certainty as amount of testing it received with these changes is too little.