mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 07:46:21 +02:00
Also make the backwards compatible case of RemoteStore::addToStore run in constant memory
Just because we can.
This commit is contained in:
parent
97002b684c
commit
ec91840e70
1 changed files with 14 additions and 14 deletions
|
@ -385,21 +385,21 @@ void RemoteStore::addToStore(const ValidPathInfo & info, Source & source,
|
|||
if (GET_PROTOCOL_MINOR(conn->daemonVersion) < 18) {
|
||||
conn->to << wopImportPaths;
|
||||
|
||||
StringSink sink;
|
||||
sink << 1 // == path follows
|
||||
;
|
||||
copyNAR(source, sink);
|
||||
sink
|
||||
<< exportMagic
|
||||
<< info.path
|
||||
<< info.references
|
||||
<< info.deriver
|
||||
<< 0 // == no legacy signature
|
||||
<< 0 // == no path follows
|
||||
;
|
||||
auto source2 = sinkToSource([&](Sink & sink) {
|
||||
sink << 1 // == path follows
|
||||
;
|
||||
copyNAR(source, sink);
|
||||
sink
|
||||
<< exportMagic
|
||||
<< info.path
|
||||
<< info.references
|
||||
<< info.deriver
|
||||
<< 0 // == no legacy signature
|
||||
<< 0 // == no path follows
|
||||
;
|
||||
});
|
||||
|
||||
StringSource source(*sink.s);
|
||||
conn->processStderr(0, &source);
|
||||
conn->processStderr(0, source2.get());
|
||||
|
||||
auto importedPaths = readStorePaths<PathSet>(*this, conn->from);
|
||||
assert(importedPaths.size() <= 1);
|
||||
|
|
Loading…
Reference in a new issue