diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2008-11-29 01:09:35 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2008-11-29 01:09:35 +0000 |
commit | 0381f48936b47f4b526f51a8f80787d14c9b2f93 (patch) | |
tree | ab908c0ef3874c60b09127b187c7db824f4b6c13 /Lib/xmlrpclib.py | |
parent | 21d2e59ab1581584818a713b3ed0621b59b9d92b (diff) | |
download | cpython-git-0381f48936b47f4b526f51a8f80787d14c9b2f93.tar.gz |
Send HTTP headers and message body in a single send() call.
This change addresses part of issue 4336.
Change endheaders() to take an optional message_body argument
that is sent along with the headers. Change xmlrpclib and
httplib's other methods to use this new interface.
It is more efficient to make a single send() call, which should
get the entire client request into one packet (assuming it is
smaller than the MTU) and will avoid the long pause for delayed
ack following timeout.
Also:
- Add a comment about the buffer size for makefile().
- Extract _set_content_length() method and fix whitespace issues there.
Diffstat (limited to 'Lib/xmlrpclib.py')
-rw-r--r-- | Lib/xmlrpclib.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py index a916fa1148..1044f3436b 100644 --- a/Lib/xmlrpclib.py +++ b/Lib/xmlrpclib.py @@ -1346,9 +1346,7 @@ class Transport: def send_content(self, connection, request_body): connection.putheader("Content-Type", "text/xml") connection.putheader("Content-Length", str(len(request_body))) - connection.endheaders() - if request_body: - connection.send(request_body) + connection.endheaders(request_body) ## # Parse response. |