summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpc
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2009-02-02 16:04:04 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2009-02-02 16:04:04 (GMT)
commit7e11b3f52247f0a0fd8be8879873a74d4ec02b38 (patch)
tree578dba804293c292fb033364d9df748f5101f612 /Lib/xmlrpc
parentbc186a87ccd09a62339492cfca794841cab07087 (diff)
downloadcpython-7e11b3f52247f0a0fd8be8879873a74d4ec02b38.zip
cpython-7e11b3f52247f0a0fd8be8879873a74d4ec02b38.tar.gz
cpython-7e11b3f52247f0a0fd8be8879873a74d4ec02b38.tar.bz2
merging / reimplementing r68532 from the trunk to Py3k
Enable buffering for HTTPResponse's fp. read() behaves identically for buffered and non-buffered IO. read(n) also won't block if n bytes are availble on the socket. There is therefore no reason not to use buffering. The reason 2.x disables buffering by default, that some clients may be accessing the underlying socket directly and so bypass the buffering buffer, doesn't apply in 3.x with its redesigned IO library. See issue 4448 and issue 4879
Diffstat (limited to 'Lib/xmlrpc')
-rw-r--r--Lib/xmlrpc/client.py21
1 files changed, 2 insertions, 19 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index c752621..e66ee84 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -1129,7 +1129,7 @@ class Transport:
self.verbose = verbose
- return self._parse_response(resp, None)
+ return self.parse_response(resp)
##
# Create parser.
@@ -1212,29 +1212,12 @@ class Transport:
# @return Response tuple and target method.
def parse_response(self, file):
- # compatibility interface
- return self._parse_response(file, None)
-
- ##
- # Parse response (alternate interface). This is similar to the
- # parse_response method, but also provides direct access to the
- # underlying socket object (where available).
- #
- # @param file Stream.
- # @param sock Socket handle (or None, if the socket object
- # could not be accessed).
- # @return Response tuple and target method.
-
- def _parse_response(self, file, sock):
# read response from input file/socket, and parse it
p, u = self.getparser()
while 1:
- if sock:
- response = sock.recv(1024)
- else:
- response = file.read(1024)
+ response = file.read(1024)
if not response:
break
if self.verbose: