]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
RequestHandler sets its close callback on the HTTPConnection, not the IOStream.
authorBen Darnell <ben@bendarnell.com>
Sun, 4 Aug 2013 22:10:21 +0000 (18:10 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 4 Aug 2013 22:10:21 +0000 (18:10 -0400)
Fixes a bug in which close callbacks would never be called for subsequent
requests on a reused connection.

tornado/web.py

index e09dda9bcf2552774b9cb5874833ec19a93db2ac..c33c923f423540298417aca96b23bdbc25ecb866 100644 (file)
@@ -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)