changeset 3555:dc7590f9c3b0

request_fcgi.send_file(): flush often to avoid big memory consumption for sending of big file attachments
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 05 May 2008 09:56:30 +0200
parents c0becca3d0d9
children 2b6f1d6c485d
files MoinMoin/request/request_fcgi.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/request_fcgi.py	Sun May 04 20:56:30 2008 +0200
+++ b/MoinMoin/request/request_fcgi.py	Mon May 05 09:56:30 2008 +0200
@@ -50,6 +50,12 @@
         except Exception:
             raise RemoteClosedConnection()
 
+    def send_file(self, fileobj, bufsize=8192, do_flush=True):
+        # as thfcgi buffers everything we write until we do a flush, we use
+        # do_flush=True as default here (otherwise the sending of big file
+        # attachments would consume lots of memory)
+        return RequestBase.send_file(self, fileobj, bufsize, do_flush)
+
     def flush(self):
         """ Flush output stream. """
         self.fcgreq.flush_out()