[Checkins] SVN: zope.publisher/branches/3.4/ fix XMLRPC and PUT freeze under WSGI(paster.httpserver)

Michael Haubenwallner michael at d2m.at
Fri Jun 26 11:37:18 EDT 2009


Log message for revision 101291:
  fix XMLRPC and PUT freeze under WSGI(paster.httpserver)

Changed:
  U   zope.publisher/branches/3.4/CHANGES.txt
  U   zope.publisher/branches/3.4/src/zope/publisher/http.py
  U   zope.publisher/branches/3.4/src/zope/publisher/xmlrpc.py

-=-
Modified: zope.publisher/branches/3.4/CHANGES.txt
===================================================================
--- zope.publisher/branches/3.4/CHANGES.txt	2009-06-26 14:46:14 UTC (rev 101290)
+++ zope.publisher/branches/3.4/CHANGES.txt	2009-06-26 15:37:18 UTC (rev 101291)
@@ -4,8 +4,12 @@
 3.4.8 (unreleased)
 ------------------
 
-* ...
+* Fix LP #332063 and LP #283089: XMLRPC is broken for paster.httpserver
+  replace readlines with readline
 
+* Backport fix from z.p 3.5.3: PUT is broken for paster.httpserver
+  (revision 87610)
+
 3.4.7 (2008-09-22)
 ------------------
 

Modified: zope.publisher/branches/3.4/src/zope/publisher/http.py
===================================================================
--- zope.publisher/branches/3.4/src/zope/publisher/http.py	2009-06-26 14:46:14 UTC (rev 101290)
+++ zope.publisher/branches/3.4/src/zope/publisher/http.py	2009-06-26 15:37:18 UTC (rev 101291)
@@ -202,9 +202,10 @@
             self.cacheStream = StringIO()
         else:
             self.cacheStream = TemporaryFile()
+        self.size = size and int(size) or -1
 
     def getCacheStream(self):
-        self.read()
+        self.read(self.size)
         self.cacheStream.seek(0)
         return self.cacheStream
 

Modified: zope.publisher/branches/3.4/src/zope/publisher/xmlrpc.py
===================================================================
--- zope.publisher/branches/3.4/src/zope/publisher/xmlrpc.py	2009-06-26 14:46:14 UTC (rev 101290)
+++ zope.publisher/branches/3.4/src/zope/publisher/xmlrpc.py	2009-06-26 15:37:18 UTC (rev 101291)
@@ -46,10 +46,15 @@
         'See IPublisherRequest'
         # Parse the request XML structure
 
-        # XXX using readlines() instead of lines()
-        # as twisted's BufferedStream sends back
-        # an empty stream here for read() (bug)
-        lines = ''.join(self._body_instream.readlines())
+        # XXX using readline() instead of readlines()
+        # as readlines() is not working with 
+        # paster.httpserver
+        lines = ''
+        while True:
+            line = self._body_instream.readline()
+            if not line:
+                break
+            lines += line
         self._args, function = xmlrpclib.loads(lines)
 
         # Translate '.' to '/' in function to represent object traversal.



More information about the Checkins mailing list