]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Document --disable-ipv6 fix and only apply it when family==AF_UNSPEC.
authorBen Darnell <ben@bendarnell.com>
Thu, 24 Jan 2013 03:35:16 +0000 (22:35 -0500)
committerBen Darnell <ben@bendarnell.com>
Thu, 24 Jan 2013 03:35:16 +0000 (22:35 -0500)
tornado/netutil.py
website/sphinx/releases/next.rst

index 0d711d4d9c2ddd4858f7dd00576887241b19c43e..1a80d5de88f1efee6107f12abb6ed5c28683ac0b 100644 (file)
@@ -53,7 +53,12 @@ def bind_sockets(port, address=None, family=socket.AF_UNSPEC, backlog=128, flags
     sockets = []
     if address == "":
         address = None
-    if not socket.has_ipv6:
+    if not socket.has_ipv6 and family == socket.AF_UNSPEC:
+        # Python can be compiled with --disable-ipv6, which causes
+        # operations on AF_INET6 sockets to fail, but does not
+        # automatically exclude those results from getaddrinfo
+        # results.
+        # http://bugs.python.org/issue16208
         family = socket.AF_INET
     if flags is None:
         flags = socket.AI_PASSIVE
index 013d1b0ed8714124eaab45bb33efb8f95080ac65..cd15401fb35f2c2e09a6eae5999cdb2b4f4f1808 100644 (file)
@@ -228,3 +228,6 @@ In progress
   port available in 12.10 (``apt-get install python3-pycurl``).  This port
   currently has bugs that prevent it from handling arbitrary binary data
   but it should work for textual (utf8) resources.
+* `tornado.netutil.bind_sockets` now works when Python was compiled
+  with ``--disable-ipv6`` but IPv6 DNS resolution is available on the
+  system.