changeset 1076:8c8b63ad1d17

Worked around the FastCGI problem on Lighttpd: empty lines in the error log Thanks to Jay Soffian
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Wed, 26 Jul 2006 11:21:54 +0200
parents 2ecd1e6c084d
children e015da143653
files MoinMoin/support/thfcgi.py docs/CHANGES.aschremmer
diffstat 2 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/support/thfcgi.py	Tue Jul 25 13:18:30 2006 +0200
+++ b/MoinMoin/support/thfcgi.py	Wed Jul 26 11:21:54 2006 +0200
@@ -327,17 +327,18 @@
         self.have_finished = 1
 
         # stderr
-        self.err.reset()
-        rec = Record()
-        rec.rec_type = FCGI_STDERR
-        rec.req_id = self.req_id
-        data = self.err.read()
-        while data:
-            chunk, data = self.getNextChunk(data)
-            rec.content = chunk
-            rec.writeRecord(self.conn)
-        rec.content = ""
-        rec.writeRecord(self.conn)      # Terminate stream
+        if self.err.tell(): # just send err record if there is data on the err stream
+            self.err.reset()
+            rec = Record()
+            rec.rec_type = FCGI_STDERR
+            rec.req_id = self.req_id
+            data = self.err.read()
+            while data:
+                chunk, data = self.getNextChunk(data)
+                rec.content = chunk
+                rec.writeRecord(self.conn)
+            rec.content = ""
+            rec.writeRecord(self.conn)      # Terminate stream
 
         # stdout
         self.out.reset()
--- a/docs/CHANGES.aschremmer	Tue Jul 25 13:18:30 2006 +0200
+++ b/docs/CHANGES.aschremmer	Wed Jul 26 11:21:54 2006 +0200
@@ -35,6 +35,7 @@
     * cgitb can hide particular names, this avoids information leaks
       if the user files cannot be parsed for example
     * Fixed User.__repr__ - it is insane to put the ID in there
+    * Worked around the FastCGI problem on Lighttpd: empty lines in the error log, thanks to Jay Soffian
 
   Other Changes:
     * Refactored conflict resolution and XMLRPC code.