]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Remove unused protocol field from HTTP1ConnectionParams
authorBen Darnell <ben@bendarnell.com>
Sun, 27 Apr 2014 04:07:15 +0000 (00:07 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 27 Apr 2014 04:07:15 +0000 (00:07 -0400)
tornado/http1connection.py
tornado/httpserver.py
tornado/simple_httpclient.py

index cb1b85eebb68f9956864db80fea3a25dd53ac0ab..2e88f36426044b7b2a8c5204d4933c8623b0f89a 100644 (file)
@@ -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
index 473051947d0c86bfaf9148591b9ec714c0804e85..4a82951162bf48a2a6d5580da7461c7da63c9ac4 100644 (file)
@@ -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)
index 468f536c4f1e9cf76f7c529658d318da8cfbe55c..74580699fbb86f380a74d23dd4554a7b639ad66c 100644 (file)
@@ -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)