Skip to content

Conversation

@cedar10bits
Copy link

@cedar10bits cedar10bits commented Jul 23, 2017

I want to use this library, but unfortunately I have to use Go 1.7.6 on Windows/Linux.
On Windows, in case of "no such host", net.DNSError.Err is "dnsquery: DNS name does not exist".
(if Go 1.8.3 on Windows, "no such host")
So, even if expected result is "none", spf.CheckHost returns "temperror".

This pull request is a fix for this case.

@cedar10bits
Copy link
Author

Sorry for some operation mistakes of this pull request(close, reopen, ... ).

@zaccone
Copy link
Owner

zaccone commented Jul 26, 2017

Hi, just got back from vacation. Will review your change today or tomorrow. Thanks for pull request!

@zaccone
Copy link
Owner

zaccone commented Aug 5, 2017

Hi, Thanks again for the pull request and patience.

Note I don't have any way to test the library on Windows.

From what I understood the problem is that on windows literal error value is different and the code does not enter correct branch and returns invalid value.
Why not then add extra if in the branch? THe PR would be like +1 maybe 2 lines.

@cedar10bits
Copy link
Author

cedar10bits commented Aug 10, 2017

I add "isNoHost" function to avoid code duplication because there were two "no host" checks.
If I do not add "isNoHost", I will have to write same if statement twice.

And if other "no host" case found, I will have to do so, too.
If three cases, I will have to write six if. I don't want to write too many if.

@cedar10bits
Copy link
Author

@zaccone Could you reply to my opinion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants