Commit 62a74d35 authored by Denis Bilenko's avatar Denis Bilenko

wsgi.py: remove server_event parameter from server()

parent 2610dd63
......@@ -52,8 +52,8 @@ def format_date_time(timestamp):
class Input(object):
def __init__(self, rfile, content_length, wfile=None, wfile_line=None,
chunked_input=False):
def __init__(self, rfile, content_length, wfile=None, wfile_line=None, chunked_input=False):
self.rfile = rfile
if content_length is not None:
content_length = int(content_length)
......@@ -130,7 +130,7 @@ class Input(object):
class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
protocol_version = 'HTTP/1.1'
minimum_chunk_size = MINIMUM_CHUNK_SIZE
def handle_one_request(self):
if self.server.max_http_version:
self.protocol_version = self.server.max_http_version
......@@ -341,6 +341,7 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
class Server(BaseHTTPServer.HTTPServer):
def __init__(self, socket, address, app, log=None, environ=None, max_http_version=None, protocol=HttpProtocol, minimum_chunk_size=None):
self.outstanding_requests = 0
self.socket = socket
......@@ -379,10 +380,11 @@ class Server(BaseHTTPServer.HTTPServer):
self.log.write(message + '\n')
def server(sock, site, log=None, environ=None, max_size=None, max_http_version=DEFAULT_MAX_HTTP_VERSION, protocol=HttpProtocol, server_event=None, minimum_chunk_size=None):
serv = Server(sock, sock.getsockname(), site, log, environ=None, max_http_version=max_http_version, protocol=protocol, minimum_chunk_size=minimum_chunk_size)
if server_event is not None:
server_event.send(serv)
def server(sock, site, log=None, environ=None, max_size=None, max_http_version=DEFAULT_MAX_HTTP_VERSION,
protocol=HttpProtocol, minimum_chunk_size=None):
serv = Server(sock, sock.getsockname(), site, log, environ=None,
max_http_version=max_http_version, protocol=protocol,
minimum_chunk_size=minimum_chunk_size)
if max_size is None:
max_size = DEFAULT_MAX_SIMULTANEOUS_REQUESTS
pool = Pool(size=max_size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment