wsgi: close timed out client connections

This commit is contained in:
Sergey Shepelev
2013-08-08 18:46:38 +04:00
parent dfc08f7947
commit 30fd49f44b

View File

@@ -585,6 +585,7 @@ class Server(BaseHTTPServer.HTTPServer):
proto.__init__(sock, address, self)
except socket.timeout:
# Expected exceptions are not exceptional
sock.close()
if self.debug:
# similar to logging "accepted" in server()
self.log_message('(%s) timed out %r' % (self.pid, address))