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.1.1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3755fb840c53549bc371797ccc6a85c24c475350;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 1f2695a7c..d2a1e3380 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)