-
Notifications
You must be signed in to change notification settings - Fork 8k
Fixed bug #73594 (dns_get_record() does not populate $additional out parameter) #2222
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
Conversation
|
Comment on behalf of krakjoe at php.net: labelling |
|
Travis check fail seems to be unrelated. |
|
Is there anything else I can do to get this merged? @weltling ? |
|
@weirdan oh, i didn't follow this bug. Thanks for the ping, will check soon. |
|
@weirdan the test doesn't pass with 5.6, but it was supposed to pass with it, right? Otherwise, there seems to be a mistake in the documentation, as the fifth argument is documented as pass-by-ref, which is not happening indeed. To the test, could you please give a hint? Thanks. |
|
tl;dr: the test works with 5.6, but it's fragile and may fail in your specific environment. The documentation is right The test, unfortunately, is very sensitive to environment, as it queries the default DNS recursor for your host (could be your provider's, or your home router, or something else) and there's no easy way to change that. DNS servers have their own ideas on what to put to that additional section, and yours may have decided to not put anything. Here's, for example, two dig results, one using my office VPN and another one is from my direct home connection: Home: Documentation is actually right, that parameter should be passed by ref, as it's a DNS server that may return something in additional section. As you can see from the code, that array is populated when processing the reply. If wasn't meant to be passed by ref, there would be no reason to populate it inside this function. |
|
The fifth argument is called You're right, the test passed on another machine, without any preparations. I see now in the ticket, that you set an additional nameserver in /etc/resolv.conf. This is not going to work for the arbitrary test environment, so it is should not be done. The test will be skip on Travis as an online test, though. IMO, having some code to skip on unsuitable environment would make sense. Maybe calling Another thing also - as the $authns arg is touched, it should be tested as well. Probably would make sense to add a separate test for it. Thanks. |
|
@weltling You're right, the docs are wrong here. Fixed in http://svn.php.net/viewvc?view=revision&revision=341411. The raw argument is also missing from the proto comment in the code. I think it's okay to merge this fix without a test. Right now get_dns_record() does not have any tests, presumably because of the problems discussed here. It certainly would be good to have tests for this function, but I don't think we should require them for this specific small fix. |
* Added SKIPIF sections to check local resolver * Added test to check $authns parameter
|
@weltling fixed tests as per your suggestions |
No description provided.