1
1
Fork 0
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:
Sergei Zimmerman 2025-10-28 03:02:02 +03:00 committed by John Ericson
parent e3c41407f9
commit e947c895ec
6 changed files with 16 additions and 38 deletions

View file

@ -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) {