#942: WSGIServer tries to set TCP options on UNIX socket
------------------------+---------------------------------------------------
Reporter: guest | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone:
Component: wsgiserver | Keywords:
------------------------+---------------------------------------------------
WSGIServer tries to set TCP option (nodelay which is True by default since
3.1) on UNIX socket, which produces error (socket.error: (42, 'Protocol
not available')).
Attached patch fixes this issue. Tested on OpenBSD 4.6 with both 3.1.1 and
3.2.0 from trunk.
{{{
--- wsgiserver/__init__.py.orig Thu Jul 16 05:33:09 2009
+++ wsgiserver/__init__.py Thu Jul 16 05:34:34 2009
@@ -1649,6 +1649,9 @@
if isinstance(self.bind_addr, basestring):
# AF_UNIX socket
+ # AF_UNIX socket doesn't have TCP options
+ self.nodelay = False
+
# So we can reuse the socket...
try: os.unlink(self.bind_addr)
except: pass
}}}
--
Ticket URL: <
http://www.cherrypy.org/ticket/942>
CherryPy <
http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework