]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/web/filenode.py
web/filenode.py: rely on Request.notifyFinish. Closes #1366.
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / web / filenode.py
index 3e4abf13c28eb2ed3a4cb9f1a9cef1a8d6952cd9..18ffe2df22a11b05c862e7e40082d75578ab3d94 100644 (file)
@@ -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)