self.body_timeout = body_timeout
self.use_gzip = use_gzip
-class HTTP1Connection(object):
+class HTTP1Connection(httputil.HTTPConnection):
"""Implements the HTTP/1.x protocol.
This class can be on its own for clients, or via `HTTP1ServerConnection`
so that small responses can be written in the same call as their
headers.
:arg callback: a callback to be run when the write is complete.
- :arg has_body: as an optimization, may be ``False`` to indicate
- that no further writes will be coming.
+ :arg bool has_body: may be false to indicate that this message
+ has no body (and so does not need either a Content-Length
+ or Transfer-Encoding)
Returns a `.Future` if no callback is given.
"""
return WSGIAdapter(self)(environ, start_response)
-class _WSGIConnection(object):
+class _WSGIConnection(httputil.HTTPConnection):
def __init__(self, method, start_response, context):
self.method = method
self.start_response = start_response
# so we can simply ignore the callback.
pass
- def write_headers(self, start_line, headers, chunk=None, callback=None):
+ def write_headers(self, start_line, headers, chunk=None, callback=None,
+ has_body=True):
if self.method == 'HEAD':
self._expected_content_remaining = 0
elif 'Content-Length' in headers: