Merge pull request #428 from Unrud/patch-22

Add timeout to connections, limit size of request body and limit number of parallel connections
This commit is contained in:
Guillaume Ayoub
2016-07-14 02:06:24 +02:00
committed by GitHub
4 changed files with 65 additions and 18 deletions

View File

@@ -175,6 +175,9 @@ def serve(configuration, logger):
name, filename, exception))
else:
server_class = ThreadedHTTPServer
server_class.client_timeout = configuration.getint("server", "timeout")
server_class.max_connections = configuration.getint("server",
"max_connections")
if not configuration.getboolean("server", "dns_lookup"):
RequestHandler.address_string = lambda self: self.client_address[0]