use aiodns.DNSResolver.gethostbyname()#1136
Merged
asvetlov merged 1 commit intoaio-libs:masterfrom Aug 30, 2016
Merged
Conversation
Current coverage is 98.28% (diff: 100%)@@ master #1136 diff @@
==========================================
Files 28 28
Lines 6465 6474 +9
Methods 0 0
Messages 0 0
Branches 1083 1085 +2
==========================================
+ Hits 6354 6363 +9
Misses 61 61
Partials 50 50
|
Member
|
Cool! |
6bdfa37 to
13097c6
Compare
13097c6 to
f31b009
Compare
Contributor
Author
|
Hi, I updated my patch, rebased master and eventually defeated the CI and coverage checks. Tell me if there is something missing. |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aiodns 1.1 has been released this weekend, it adds the support of
DNSResolver.gethostbyname(). This PR updatesaiohttp.resolver.AsyncResolverto use it.The main difference between
DNSResolver.query()andgethostbyname()is that the latter works more likegetaddrinfo()and reads/etc/hostsbefore it tries to issue a query to a DNS server. It effectively allows to use local hostnames such aslocalhost.I don't know if it's better to require aiodns 1.1 or if the code should instead check if
gethostbyname()is available and fallback toquery()if not. We can also add a third Resolver class instead of modifying AsyncResolver, but it don't think that's really useful.In the first case, I will add the requirement notice in the documentation/readme/requirements, otherwise I can rewrite the PR.