]> granicus.if.org Git - python/commitdiff
Merged revisions 70940 via svnmerge
authorGeorg Brandl <georg@python.org>
Wed, 1 Apr 2009 04:27:47 +0000 (04:27 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 1 Apr 2009 04:27:47 +0000 (04:27 +0000)
........
  r70940 | georg.brandl | 2009-03-31 23:21:14 -0500 (Di, 31 Mär 2009) | 2 lines

  The SimpleXMLRPCServer's CGI handler now runs like a pony.
........

Lib/xmlrpc/server.py

index 4ddc0049d6702f7059dc1d1c6e1307ff8fcb48ca..eb807c484b7c64a2264048739eb96aef4f45d6f7 100644 (file)
@@ -588,8 +588,12 @@ class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
             self.handle_get()
         else:
             # POST data is normally available through stdin
+            try:
+                length = int(os.environ.get('CONTENT_LENGTH', None))
+            except ValueError:
+                length = -1
             if request_text is None:
-                request_text = sys.stdin.read()
+                request_text = sys.stdin.read(length)
 
             self.handle_xmlrpc(request_text)