mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
binary-cache-store: UpsertFile accept Source & instead of std::istream
This commit is contained in:
parent
e3c41407f9
commit
e947c895ec
6 changed files with 16 additions and 38 deletions
|
|
@ -135,15 +135,11 @@ bool HttpBinaryCacheStore::fileExists(const std::string & path)
|
|||
}
|
||||
|
||||
void HttpBinaryCacheStore::upsertFile(
|
||||
const std::string & path,
|
||||
std::shared_ptr<std::basic_iostream<char>> istream,
|
||||
const std::string & mimeType,
|
||||
uint64_t sizeHint)
|
||||
const std::string & path, Source & source, const std::string & mimeType, uint64_t sizeHint)
|
||||
{
|
||||
auto req = makeRequest(path);
|
||||
req.method = HttpMethod::PUT;
|
||||
auto data = StreamToSourceAdapter(istream).drain();
|
||||
|
||||
auto data = source.drain();
|
||||
auto compressionMethod = getCompressionMethod(path);
|
||||
|
||||
if (compressionMethod) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue