You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #1813 - smarnach:stream-s3-uploads, r=sgrif
Allow streaming uploads to S3.
Currently the interface in the `s3` crate accepts the contents of an upload as a byte slice, which
so far isn't much of a problem, since crate uploads are generally below 10MB. When uploading public
database dumps to S3 (#1800), however, we don't want to keep the whole dump in memory at once.
This change basically changes the type of the uploaded content from `&[u8]` to a generic type
implementing `std::io::Read + Send + 'static`, which are the trait bounds `reqwest` requires for the
request body.
The PUT request to S3 needs to include a Content-Length header. Since a `std::io::Read` does not
have a length, we need to add another parameter for the content length, and pass it on to `reqwest`.
0 commit comments