From: Ben Darnell Date: Sun, 27 Apr 2014 04:07:15 +0000 (-0400) Subject: Remove unused protocol field from HTTP1ConnectionParams X-Git-Tag: v4.0.0b1~91^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4dc5aef1a66c9d95e201eb86f6c521870106212;p=thirdparty%2Ftornado.git Remove unused protocol field from HTTP1ConnectionParams --- diff --git a/tornado/http1connection.py b/tornado/http1connection.py index cb1b85eeb..2e88f3642 100644 --- a/tornado/http1connection.py +++ b/tornado/http1connection.py @@ -33,13 +33,12 @@ from tornado.util import GzipDecompressor 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) @@ -48,7 +47,6 @@ class HTTP1ConnectionParameters(object): :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 diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 473051947..4a8295116 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -141,8 +141,8 @@ class HTTPServer(TCPServer, httputil.HTTPServerConnectionDelegate): 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, @@ -163,7 +163,7 @@ class HTTPServer(TCPServer, httputil.HTTPServerConnectionDelegate): 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) diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index 468f536c4..74580699f 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -339,7 +339,7 @@ class _HTTPConnection(httputil.HTTPMessageDelegate): 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)