diff MoinMoin/action/AttachFile.py @ 3553:1052c105b16f

new request.send_file() call, making it possible to use server-specific optimizations
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 04 May 2008 18:47:03 +0200
parents ee0644a26e30
children 6fe1ea4d9d1a
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat May 03 22:46:14 2008 +0200
+++ b/MoinMoin/action/AttachFile.py	Sun May 04 18:47:03 2008 +0200
@@ -779,8 +779,6 @@
 
 
 def _do_get(pagename, request):
-    import shutil
-
     _ = request.getText
 
     pagename, filename, fpath = _access_file(pagename, request)
@@ -815,7 +813,7 @@
         ])
 
         # send data
-        shutil.copyfileobj(open(fpath, 'rb'), request, 8192)
+        request.send_file(open(fpath, 'rb'))
 
 
 def _do_install(pagename, request):