mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 17:29:36 +01:00
libstore: Make uploads with filetransfer.cc consume a RestartableSource
Make uploads run in constant memory. Also change the callbacks to be noexcept, since we really don't want to be unwinding the stack in the curl thread. That will definitely corrupt that stack and make nix/curl crash in very bad ways.
This commit is contained in:
parent
b8d7f551e4
commit
cf75079bd8
9 changed files with 87 additions and 42 deletions
|
|
@ -53,7 +53,8 @@ protected:
|
|||
|
||||
bool fileExists(const std::string & path) override;
|
||||
|
||||
void upsertFile(const std::string & path, Source & source, const std::string & mimeType, uint64_t sizeHint) override
|
||||
void upsertFile(
|
||||
const std::string & path, RestartableSource & source, const std::string & mimeType, uint64_t sizeHint) override
|
||||
{
|
||||
auto path2 = config->binaryCacheDir + "/" + path;
|
||||
static std::atomic<int> counter{0};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue