Nir Soffer has posted comments on this change.

Change subject: core: GET requests - use Range header
......................................................................


Patch Set 6:

(4 comments)

http://gerrit.ovirt.org/#/c/28465/6/vdsm/BindingXMLRPC.py
File vdsm/BindingXMLRPC.py:

Line 153:                                                   
operationEndCallback,
Line 154:                                                   startEvent, volUUID)
Line 155: 
Line 156:                     if response['status']['code'] == 0:
Line 157:                         self.send_response(httplib.PARTIAL_CONTENT)
Nice!
Line 158:                         self.send_header(self.HEADER_CONTENT_TYPE,
Line 159:                                          'application/octet-stream')
Line 160:                         self.send_header(self.HEADER_CONTENT_LENGTH, 
length)
Line 161:                         self.send_header(self.HEADER_CONTENT_RANGE,


Line 271:                     raise self.RequestException(
Line 272:                         httplib.BAD_REQUEST,
Line 273:                         "range in an unsupported format")
Line 274: 
Line 275:                 min = m.group(1)
Please use the same terms used in the rfc - first_byte
Line 276:                 if min != '0':
Line 277:                     raise self.RequestException(
Line 278:                         httplib.BAD_REQUEST,
Line 279:                         "range first byte position other than 0 isn't 
"


Line 278:                         httplib.BAD_REQUEST,
Line 279:                         "range first byte position other than 0 isn't 
"
Line 280:                         "supported")
Line 281: 
Line 282:                 max = m.group(2)
Please use the same terms used in the rfc - last_byte
Line 283:                 if max == '':
Line 284:                     raise self.RequestException(
Line 285:                         httplib.BAD_REQUEST,
Line 286:                         "unspecified range last byte position isn't 
supported")


Line 284:                     raise self.RequestException(
Line 285:                         httplib.BAD_REQUEST,
Line 286:                         "unspecified range last byte position isn't 
supported")
Line 287: 
Line 288:                 return self._getInt(max)
There is a off-by-one error here. When the client send the range 0-499, the 
meaning is get me the first 500 bytes (see the examples section in the rfc). So 
this should be:

    return self._getInt(last_byte + 1)
Line 289: 
Line 290:             def send_error(self, error, message, exc_info=False):
Line 291:                 try:
Line 292:                     self.log.error(message, exc_info=exc_info)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8164867347b1cf800efd2a78cc98dbc10c02ee0d
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to