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

Problem: client potentially loses data #22

Closed
rpedde opened this issue Mar 25, 2014 · 4 comments
Closed

Problem: client potentially loses data #22

rpedde opened this issue Mar 25, 2014 · 4 comments

Comments

@rpedde
Copy link
Contributor

rpedde commented Mar 25, 2014

If the buffer provided by a client is smaller than the size of the pending data chunk, the excess data in the chunk is thrown away.

The client read function really needs to keep an offset of the position of the current chunk, and continue to serve from it until the chunk is exhausted.

In a perfect world, we'd never return short reads, either. Reads shorter then requested size happen, but are surprising unless at end of file, I think. So a single read in excess of the pending chunk size should probably continue to pull chunks until the client supplied buffer is full.

This might be something better deferred to after the raw client re-write, though. Just noting this for posterity.

@hintjens
Copy link
Member

Are we agreed that the API should deliver a stream, not chunks?

On Tue, Mar 25, 2014 at 11:53 PM, Ron Pedde notifications@github.comwrote:

If the buffer provided by a client is smaller than the size of the pending
data chunk, the excess data in the chunk is thrown away.

The client read function really needs to keep an offset of the position of
the current chunk, and continue to serve from it until the chunk is
exhausted.

In a perfect world, we'd never return short reads, either. Reads shorter
then requested size happen, but are surprising unless at end of file, I
think. So a single read in excess of the pending chunk size should probably
continue to pull chunks until the client supplied buffer is full.

This might be something better deferred to after the raw client re-write,
though. Just noting this for posterity.

Reply to this email directly or view it on GitHubhttps://github.com//issues/22
.

@rpedde
Copy link
Contributor Author

rpedde commented Mar 27, 2014

I think from the client perspective, it should be a stream, yes.

@hintjens
Copy link
Member

OK, that's clear, thanks.

@hintjens
Copy link
Member

Closing this and replacing with #24.

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