-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SimpleXMLRPCServer cannot handle large requests #39100
Comments
SimpleXMLRPCServer throws a WSAEINTR ioerror on Under Windows, the socket.read() method cannot seem Here is a tentative patch against 2.2.3 to fix the --- /cygdrive/c/Python22/Lib/SimpleXMLRPCServer.py
2003-07-09 14:16:52.000000000 -0400
+++ /cygdrive/z/SimpleXMLRPCServer.py 2003-08-21
11:01:19.000000000 -0400
@@ -73,6 +73,8 @@
import SocketServer
import BaseHTTPServer
import sys
+import cStringIO class SimpleXMLRPCRequestHandler
(BaseHTTPServer.BaseHTTPRequestHandler):
"""Simple XML-RPC request handler class.
@@ -95,7 +97,14 @@ try:
# get arguments
- data = self.rfile.read(int(self.headers["content-
length"]))
+ max_chunk_size = 10000000
+ content_length = int(self.headers["content-
length"])
+ buffer = cStringIO.StringIO()
+ for offset in range(0, content_length,
max_chunk_size):
+ chunk_size = min(content_length - offset,
max_chunk_size)
+ buffer.write(self.rfile.read(chunk_size))
+ data = buffer.getvalue()
+ buffer.close()
params, method = xmlrpclib.loads(data)
|
Logged In: YES Marc-Andre, can you still reproduce this with Python 2.4? |
Logged In: YES I have the same problem with Python2.4 with windows and If XML-RPC server reads to large buffer, it returns only a |
Logged In: YES Why does SimpleXMLRPCServer need to be fixed if noplay: do you mean you're seeing this bug happen on Linux? |
Logged In: YES It turns out that on my Mac socket.read() runs into trouble |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: