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

Streaming of SanitizedFile. #1529

Closed
wants to merge 4 commits into from
Closed

Conversation

TreyE
Copy link

@TreyE TreyE commented Dec 12, 2014

Added streaming, where available, for moving/copying of SantizedFile.

This doesn't completely fix the issue with streaming, as that will require a re-work of the existing API to support chunked reads. However, it does keep large files out of memory where possible (e.g. Streaming a large POST body as binary) - at least in the behaviour of sanitized file.

I'm aware there is a fairly bad hack to support the legacy api - but I can't see a way around it without major incompatibilities.

When moving or copying a stream, use chunked reading.
Sanitized files need to properly delegate during copy/move.
The streaming function is now safe for legacy clients which don't
respect reading in chunks.
@bensie
Copy link
Member

bensie commented Mar 3, 2015

@TreyE Thanks for this. How would you rework the existing API to properly support this?

@bensie
Copy link
Member

bensie commented Mar 4, 2015

@TreyE If you do come back to this, please merge in the master branch, you'll have a better time with Travis testing :)

@TreyE
Copy link
Author

TreyE commented Mar 5, 2015

The way I would re-work the existing file is to allow the File api to accept the standard IO read API. Right now many of them only accept read with 0 arguments.

@bensie
Copy link
Member

bensie commented Mar 9, 2015

@TreyE We would welcome a patch for that if you're up for it :)

@kleyy
Copy link

kleyy commented Sep 1, 2015

+1

@thomasfedb
Copy link
Contributor

@TreyE I'm closing this for now, but feel free to open a new PR if you'd like to update File to conform to the standard IO#read API.

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

Successfully merging this pull request may close these issues.

4 participants