Skip to content

Commit

Permalink
Only query host address families over DNS that the local network stac…
Browse files Browse the repository at this point in the history
…k supports (aio-libs#5176) (aio-libs#5189)

* Fix for aio-libs#5156

* test for aio-libs#5156

* add changes file

* rearrange if/else

* Revert "rearrange if/else"

This reverts commit a557e4c.

* Revert "test for aio-libs#5156"

This reverts commit 9d81913.

* Revert "Fix for aio-libs#5156"

This reverts commit 48de143.

* Add AI_ADDRCONFIG flag to loop.getaddrinfo

* update changes file

Co-authored-by: Dmitry Erlikh <[email protected]>
  • Loading branch information
github-actions[bot] and derlih committed Nov 1, 2020
1 parent 1950adb commit 700cf2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/5156.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed querying the address families from DNS that the current host supports.
6 changes: 5 additions & 1 deletion aiohttp/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ async def resolve(
self, hostname: str, port: int = 0, family: int = socket.AF_INET
) -> List[Dict[str, Any]]:
infos = await self._loop.getaddrinfo(
hostname, port, type=socket.SOCK_STREAM, family=family
hostname,
port,
type=socket.SOCK_STREAM,
family=family,
flags=socket.AI_ADDRCONFIG,
)

hosts = []
Expand Down

0 comments on commit 700cf2b

Please sign in to comment.