Change in vdsm[master]: Allow GZIP transport on XMLRPC

danken at redhat.com danken at redhat.com
Fri Jun 6 11:43:48 UTC 2014


Dan Kenigsberg has posted comments on this change.

Change subject: Allow GZIP transport on XMLRPC
......................................................................


Patch Set 2: Code-Review-1

(4 comments)

http://gerrit.ovirt.org/#/c/25201/2/lib/vdsm/utils.py
File lib/vdsm/utils.py:

Line 195:     # the methods only on Python 2.6.
Line 196: 
Line 197:     if sys.version_info[:2] == (2, 6):
Line 198:         def __init__(self, *args, **kwargs):
Line 199:             self.encode_threshold = 1400
what is this magic number? Can we have a descriptive _CONSTANT instead? Doesn't it belong to the class (instead of the initialized instance)?

The added code is taken from SimpleXMLRPCServer.py. Please state so in the code and the commit message, and include the original copyright notice.
Line 200:             SimpleXMLRPCRequestHandler.__init__(self, *args, **kwargs)
Line 201: 
Line 202:         # a re to match a gzip Accept-Encoding
Line 203:         aepattern = re.compile(r"""


Line 226:                 # Get arguments by reading body of request.
Line 227:                 # We read this in chunks to avoid straining
Line 228:                 # socket.read(); around the 10 or 15Mb mark, some platforms
Line 229:                 # begin to have problems (bug #792570).
Line 230:                 max_chunk_size = 10 * 1024 * 1024
I love spaces, but they belong to another patch.
Line 231:                 size_remaining = int(self.headers["content-length"])
Line 232:                 L = []
Line 233:                 while size_remaining:
Line 234:                     chunk_size = min(size_remaining, max_chunk_size)


http://gerrit.ovirt.org/#/c/25201/2/lib/vdsm/vdscli.py.in
File lib/vdsm/vdscli.py.in:

Line 42:         method, as described in RFC 1952.
Line 43:         """
Line 44:         def __init__(self, response):
Line 45:             data = response.read()
Line 46:             with open("/tmp/client.dump", "wb") as f:
debug time leftover?
Line 47:                 f.write(data)
Line 48:             self.stringio = StringIO.StringIO(data)
Line 49:             gzip.GzipFile.__init__(self, mode="rb", fileobj=self.stringio)
Line 50: 


Line 97:         try:
Line 98:             return old_parse_response(*args, **kwargs)
Line 99:         except ExpatError:
Line 100:             sys.stderr.write('Parsing error was thrown during parsing '
Line 101:                              'response when provided: {0}'.format(args))
unrelated change
Line 102:             raise
Line 103:     transport.parse_response = wrapped_parse_response
Line 104:     return transport
Line 105: 


-- 
To view, visit http://gerrit.ovirt.org/25201
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iebdaa04b17e2c1df1c1852ed536c5d6d8ec8d88b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list