-
Notifications
You must be signed in to change notification settings - Fork 87
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
Validate all addresses resolved from hostname #14
Conversation
Signed-off-by: Artemiy Ryabinkov <getlag@ya.ru>
Signed-off-by: Artemiy Ryabinkov <getlag@ya.ru>
Signed-off-by: Artemiy Ryabinkov <getlag@ya.ru>
@jackc what do you think about this PR? |
Sorry, somehow I unwatched my own project so I didn't see this until you pinged me... This PR is actually combining two concerns.
There are some subtle edge cases with each. The custom resolver appears to only be called by The other issue is what happens when DNS changes. A Config could be used for a long time in a server process. and it could be stuck never seeing the updated DNS. For both concerns to work properly, the DNS resolution (and expansion to multiple IPs) has to occur at dial time not parse config time. |
Hm, any kind of resolving and dealing occurs only inside But, in case of connection is broken we apparently try to reconnect, so we call
I don't see any calls of Maybe I got you wrong. |
Wow... I really shouldn't review PRs when I'm tired... For some reason I thought the changes to LGTM. |
With `expandWithIPs()` (added in jackc#14), we try all IPs.
With `expandWithIPs()` (added in #14), we try all IPs.
LookupFunc
added to config, so custom resolver can be used.fallbackConfigs
used to iterate over resolved addrs.fix: #5