From 38f9007223ec7bfcdef5ccc9f9df3aa2c8cc1b6f Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 4 Aug 2013 18:10:21 -0400 Subject: [PATCH] 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. --- tornado/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.47.2