From 3eb60ff986563e79c72b701a4a0cb6f16229089f Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 13 Oct 2011 13:12:19 -0700 Subject: [PATCH] web/filenode.py: rely on Request.notifyFinish. Closes #1366. This is safe now that tahoe depends upon Twisted>=10.1, since notifyFinish first appeared in Twisted-9.0 --- src/allmydata/web/filenode.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/allmydata/web/filenode.py b/src/allmydata/web/filenode.py index 3e4abf13..18ffe2df 100644 --- a/src/allmydata/web/filenode.py +++ b/src/allmydata/web/filenode.py @@ -452,13 +452,10 @@ class FileDownloader(rend.Page): if req.method == "HEAD": return "" - # Twisted >=9.0 throws an error if we call req.finish() on a closed - # HTTP connection. It also has req.notifyFinish() to help avoid it. finished = [] def _request_finished(ign): finished.append(True) - if hasattr(req, "notifyFinish"): - req.notifyFinish().addBoth(_request_finished) + req.notifyFinish().addBoth(_request_finished) d = self.filenode.read(req, first, size) -- 2.45.2