Skip to content
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

function returns incorrect range #1

Closed
sanfx opened this issue Jul 27, 2014 · 1 comment
Closed

function returns incorrect range #1

sanfx opened this issue Jul 27, 2014 · 1 comment

Comments

@sanfx
Copy link

sanfx commented Jul 27, 2014

the function is returning range is not correct, the if the file size is 100331 the last range tuple is 100330!

https://github.com/galeo/pyflit/blob/master/pyflit/flit.py#L420

@galeo
Copy link
Owner

galeo commented Jul 30, 2014

Hi, @sanfx
You may want to reference the W3C HTTP/1.1: Header Field Definitions about Byte Ranges:

Byte range specifications in HTTP apply to the sequence of bytes in the entity-body (not necessarily the same as the message-body).

A byte range operation MAY specify a single range of bytes, or a set of ranges within a single entity.

   ranges-specifier = byte-ranges-specifier
   byte-ranges-specifier = bytes-unit "=" byte-range-set
   byte-range-set  = 1#( byte-range-spec | suffix-byte-range-spec )
   byte-range-spec = first-byte-pos "-" [last-byte-pos]
   first-byte-pos  = 1*DIGIT
   last-byte-pos   = 1*DIGIT

The first-byte-pos value in a byte-range-spec gives the byte-offset of the first byte in a range. The last-byte-pos value gives the byte-offset of the last byte in the range; that is, the byte positions specified are inclusive. Byte offsets start at zero.
... ...

@galeo galeo closed this as completed Jul 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants