Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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)

* 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
derlih authored and commonism committed Apr 27, 2021
1 parent e61096d commit 9c83181
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
@@ -28,7 +28,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 = []

0 comments on commit 9c83181

Please sign in to comment.