From: Ben Darnell Date: Mon, 9 Mar 2015 03:08:25 +0000 (-0400) Subject: simple_httpclient: finish() should be called even for body-less GET. X-Git-Tag: v4.2.0b1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf2a54794ff5067d6d815013d6570ee10f74d5e5;p=thirdparty%2Ftornado.git simple_httpclient: finish() should be called even for body-less GET. This matters for HTTP2 where there is an explicit end-stream marker. --- diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index beb55f239..6321a81df 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -375,7 +375,6 @@ class _HTTPConnection(httputil.HTTPMessageDelegate): def _write_body(self, start_read): if self.request.body is not None: self.connection.write(self.request.body) - self.connection.finish() elif self.request.body_producer is not None: fut = self.request.body_producer(self.connection.write) if is_future(fut): @@ -386,7 +385,7 @@ class _HTTPConnection(httputil.HTTPMessageDelegate): self._read_response() self.io_loop.add_future(fut, on_body_written) return - self.connection.finish() + self.connection.finish() if start_read: self._read_response()