File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1+ Fixed DNS resolution on platforms that don't support ``socket.AI_ADDRCONFIG`` -- by :user:`maxbachmann`.
Original file line number Diff line number Diff line change 1818
1919_NUMERIC_SOCKET_FLAGS = socket .AI_NUMERICHOST | socket .AI_NUMERICSERV
2020_NAME_SOCKET_FLAGS = socket .NI_NUMERICHOST | socket .NI_NUMERICSERV
21+ _AI_ADDRCONFIG = socket .AI_ADDRCONFIG
22+ if hasattr (socket , "AI_MASK" ):
23+ _AI_ADDRCONFIG &= socket .AI_MASK
2124
2225
2326class ThreadedResolver (AbstractResolver ):
@@ -38,7 +41,7 @@ async def resolve(
3841 port ,
3942 type = socket .SOCK_STREAM ,
4043 family = family ,
41- flags = socket . AI_ADDRCONFIG ,
44+ flags = _AI_ADDRCONFIG ,
4245 )
4346
4447 hosts : List [ResolveResult ] = []
@@ -105,7 +108,7 @@ async def resolve(
105108 port = port ,
106109 type = socket .SOCK_STREAM ,
107110 family = family ,
108- flags = socket . AI_ADDRCONFIG ,
111+ flags = _AI_ADDRCONFIG ,
109112 )
110113 except aiodns .error .DNSError as exc :
111114 msg = exc .args [1 ] if len (exc .args ) >= 1 else "DNS lookup failed"
You can’t perform that action at this time.
0 commit comments