Commits

Joel Rivera  committed a9158c7

The Windows build for Python2.5 has IPV6_V6ONLY undefined,
with this in place, Vista machines happily run the server on
both socket types.
Applying patch of Peter Shinners from the issue #1130.
Closing issue #1130

  • Participants
  • Parent commits 7d7cb45

Comments (0)

Files changed (2)

File cherrypy/wsgiserver/wsgiserver2.py

 import rfc822
 import socket
 import sys
-if 'win' in sys.platform and not hasattr(socket, 'IPPROTO_IPV6'):
-    socket.IPPROTO_IPV6 = 41
+if 'win' in sys.platform and hasattr(socket, "AF_INET6"):
+    if not hasattr(socket, 'IPPROTO_IPV6'):
+        socket.IPPROTO_IPV6 = 41
+    if not hasattr(socket, 'IPV6_V6ONLY'):
+        socket.IPV6_V6ONLY = 27
 try:
     import cStringIO as StringIO
 except ImportError:

File cherrypy/wsgiserver/wsgiserver3.py

 import email.utils
 import socket
 import sys
-if 'win' in sys.platform and not hasattr(socket, 'IPPROTO_IPV6'):
-    socket.IPPROTO_IPV6 = 41
+if 'win' in sys.platform and hasattr(socket, "AF_INET6"):
+    if not hasattr(socket, 'IPPROTO_IPV6'):
+        socket.IPPROTO_IPV6 = 41
+    if not hasattr(socket, 'IPV6_V6ONLY'):
+        socket.IPV6_V6ONLY = 27
 if sys.version_info < (3,1):
     import io
 else: