summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-04-01 04:21:14 (GMT)
committerGeorg Brandl <georg@python.org>2009-04-01 04:21:14 (GMT)
commite92d4b6f57acd07ca48e842063146031e49eed15 (patch)
tree4421207bf1bdb36c7a45e887f01ce094abbea5e8 /Lib
parent02cb0eb231fc01e2a50cbe14f6da7a8df52959ef (diff)
downloadcpython-e92d4b6f57acd07ca48e842063146031e49eed15.zip
cpython-e92d4b6f57acd07ca48e842063146031e49eed15.tar.gz
cpython-e92d4b6f57acd07ca48e842063146031e49eed15.tar.bz2
The SimpleXMLRPCServer's CGI handler now runs like a pony.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SimpleXMLRPCServer.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/SimpleXMLRPCServer.py b/Lib/SimpleXMLRPCServer.py
index 43757a0..4c28688 100644
--- a/Lib/SimpleXMLRPCServer.py
+++ b/Lib/SimpleXMLRPCServer.py
@@ -598,8 +598,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)