changeset 996:bd54096490d3

fix MoinMoinBugs/XmlRpcBrokenForFastCgi, thanks to Johannes Berg
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 19 Jul 2006 23:51:45 +0200
parents b6ae650aec74
children 8953764256c7 939a545df516
files MoinMoin/support/thfcgi.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/support/thfcgi.py	Wed Jul 19 11:30:12 2006 +0200
+++ b/MoinMoin/support/thfcgi.py	Wed Jul 19 23:51:45 2006 +0200
@@ -281,8 +281,13 @@
         """Return a cgi FieldStorage constructed from the stdin and
         environ read from the server for this request."""
         self.stdin.reset()
-        return cgi.FieldStorage(fp=self.stdin, environ=self.env,
-                                keep_blank_values=1)
+        # cgi.FieldStorage will eat the input here...
+        r = cgi.FieldStorage(fp=self.stdin, environ=self.env,
+                             keep_blank_values=1)
+        # hence, we reset here so we can obtain
+        # the data again...
+        self.stdin.reset()
+        return r
 
     def _flush(self, stream):
         """Flush a stream of this request."""
@@ -478,6 +483,8 @@
         
         if not rec.content:
             self.stdin_complete = 1
+            self.stdin.reset()
+            return
 
         self.stdin.write(rec.content)