class HTTP1ConnectionParameters(object):
"""Parameters for `.HTTP1Connection` and `.HTTP1ServerConnection`.
"""
- def __init__(self, no_keep_alive=False, protocol=None, chunk_size=None,
+ def __init__(self, no_keep_alive=False, chunk_size=None,
max_header_size=None, header_timeout=None, max_body_size=None,
body_timeout=None, use_gzip=False):
"""
:arg bool no_keep_alive: If true, always close the connection after
one request.
- :arg str protocol: "http" or "https"
:arg int chunk_size: how much data to read into memory at once
:arg int max_header_size: maximum amount of data for HTTP headers
:arg float header_timeout: how long to wait for all headers (seconds)
:arg bool use_gzip: if true, decode incoming ``Content-Encoding: gzip``
"""
self.no_keep_alive = no_keep_alive
- self.protocol = protocol
self.chunk_size = chunk_size or 65536
self.max_header_size = max_header_size or 65536
self.header_timeout = header_timeout
self.request_callback = request_callback
self.no_keep_alive = no_keep_alive
self.xheaders = xheaders
+ self.protocol = protocol
self.conn_params = HTTP1ConnectionParameters(
- protocol=protocol,
use_gzip=gzip,
chunk_size=chunk_size,
max_header_size=max_header_size,
def handle_stream(self, stream, address):
context = _HTTPRequestContext(stream, address,
- self.conn_params.protocol)
+ self.protocol)
conn = HTTP1ServerConnection(
stream, self.conn_params, context)
self._connections.add(conn)
self.connection = HTTP1Connection(
self.stream, True,
HTTP1ConnectionParameters(
- no_keep_alive=True, protocol=self.parsed.scheme,
+ no_keep_alive=True,
max_header_size=self.max_header_size,
use_gzip=self.request.use_gzip),
self._sockaddr)