projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da492a8
)
asyncio: Fix _check_resolved_address() for IPv6 address
author
Victor Stinner
<victor.stinner@gmail.com>
Thu, 20 Feb 2014 15:43:09 +0000
(16:43 +0100)
committer
Victor Stinner
<victor.stinner@gmail.com>
Thu, 20 Feb 2014 15:43:09 +0000
(16:43 +0100)
Lib/asyncio/base_events.py
patch
|
blob
|
history
diff --git
a/Lib/asyncio/base_events.py
b/Lib/asyncio/base_events.py
index 69caa4d723775558cd8bff9eed5233ad5bf0680d..1615ecbf42add2a52206330ae1671aaa40a2d72c 100644
(file)
--- a/
Lib/asyncio/base_events.py
+++ b/
Lib/asyncio/base_events.py
@@
-45,10
+45,13
@@
def _check_resolved_address(sock, address):
# Ensure that the address is already resolved to avoid the trap of hanging
# the entire event loop when the address requires doing a DNS lookup.
family = sock.family
- if family not in (socket.AF_INET, socket.AF_INET6):
+ if family == socket.AF_INET:
+ host, port = address
+ elif family == socket.AF_INET6:
+ host, port, flow_info, scope_id = address
+ else:
return
- host, port = address
type_mask = 0
if hasattr(socket, 'SOCK_NONBLOCK'):
type_mask |= socket.SOCK_NONBLOCK