From: Ben Darnell Date: Sun, 4 Aug 2013 22:10:21 +0000 (-0400) Subject: RequestHandler sets its close callback on the HTTPConnection, not the IOStream. X-Git-Tag: v3.2.0b1~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38f9007223ec7bfcdef5ccc9f9df3aa2c8cc1b6f;p=thirdparty%2Ftornado.git RequestHandler sets its close callback on the HTTPConnection, not the IOStream. Fixes a bug in which close callbacks would never be called for subsequent requests on a reused connection. --- diff --git a/tornado/web.py b/tornado/web.py index e09dda9bc..c33c923f4 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -751,10 +751,10 @@ class RequestHandler(object): if hasattr(self.request, "connection"): # Now that the request is finished, clear the callback we - # set on the IOStream (which would otherwise prevent the + # set on the HTTPConnection (which would otherwise prevent the # garbage collection of the RequestHandler when there # are keepalive connections) - self.request.connection.stream.set_close_callback(None) + self.request.connection.set_close_callback(None) if not self.application._wsgi: self.flush(include_footers=True)