-
Notifications
You must be signed in to change notification settings - Fork 17
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
Proposal: Download.Read() should always return some bytes until EOF #99
Comments
An easy fix would be to retry in the top-level download implementation. |
Oh, also, it could also be a side-effect of avoiding to return error and |
@Erikvv does the uplink-c library return an error (specifically EOF) when the 0 bytes are returned at the boundary between 2 segments? |
@ifraixedes No there's no error, EOF is only at the end of the object (or requested range). |
The user usually calls
Download.Read(p []byte) (n int, err error)
in a loop. Currently at the boundary between two segments one call returns 0 bytes.This causes bugs and additional complexity for library authors and users. Example:
storj-thirdparty/nextcloud-app#4 / storj-thirdparty/uplink-php#12
storj/uplink-java#10
I propose we change the behavior so that Download.Read() never returns 0 bytes, unless there are no more bytes left to download.
I'm not sure where this behaviour actually emerges and should be changed. Maybe somewhere in storj.io/common/ranger.concatReader or storj.io/common/readcloser.multiReadCloser.
The text was updated successfully, but these errors were encountered: