``idle_connection_timeout``, ``body_timeout``, ``max_body_size``
arguments. Added support for `.HTTPServerConnectionDelegate`
instances as ``request_callback``.
+
+ .. versionchanged:: 4.1
+ `.HTTPServerConnectionDelegate.start_request` is now called with
+ two arguments ``(server_conn, request_conn)`` (in accordance with the
+ documentation) instead of one ``(request_conn)``.
"""
def __init__(self, request_callback, no_keep_alive=False, io_loop=None,
xheaders=False, ssl_options=None, protocol=None,
conn.start_serving(self)
def start_request(self, server_conn, request_conn):
- return _ServerRequestAdapter(self, request_conn)
+ return _ServerRequestAdapter(self, server_conn, request_conn)
def on_close(self, server_conn):
self._connections.remove(server_conn)
"""Adapts the `HTTPMessageDelegate` interface to the interface expected
by our clients.
"""
- def __init__(self, server, connection):
+ def __init__(self, server, server_conn, request_conn):
self.server = server
- self.connection = connection
+ self.connection = request_conn
self.request = None
if isinstance(server.request_callback,
httputil.HTTPServerConnectionDelegate):
- self.delegate = server.request_callback.start_request(connection)
+ self.delegate = server.request_callback.start_request(
+ server_conn, request_conn)
self._chunks = None
else:
self.delegate = None
def get_app(self):
class App(HTTPServerConnectionDelegate):
- def start_request(self, connection):
- return StreamingChunkSizeTest.MessageDelegate(connection)
+ def start_request(self, server_conn, request_conn):
+ return StreamingChunkSizeTest.MessageDelegate(request_conn)
return App()
def fetch_chunk_sizes(self, **kwargs):
except TypeError:
pass
- def start_request(self, connection):
+ def start_request(self, server_conn, request_conn):
# Modern HTTPServer interface
- return _RequestDispatcher(self, connection)
+ return _RequestDispatcher(self, request_conn)
def __call__(self, request):
# Legacy HTTPServer interface