diff options
-rw-r--r-- | src/libstore/daemon.cc | 8 | ||||
-rw-r--r-- | src/libstore/export-import.cc | 4 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 1181cc9e5..6a3035dda 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -453,9 +453,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store, command. (We don't trust `addToStoreFromDump` to not eagerly consume the entire stream it's given, past the length of the Nar. */ - TeeSource savedNARSource(from, saved); - ParseSink sink; /* null sink; just parse the NAR */ - parseDump(sink, savedNARSource); + copyNAR(from, saved); } else { /* Incrementally parse the NAR file, stripping the metadata, and streaming the sole file we expect into @@ -907,9 +905,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store, if (GET_PROTOCOL_MINOR(clientVersion) >= 21) source = std::make_unique<TunnelSource>(from, to); else { - TeeSource tee { from, saved }; - ParseSink ether; - parseDump(ether, tee); + copyNAR(from, saved); source = std::make_unique<StringSource>(saved.s); } diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc index 87b2f8741..e0f3eb6c9 100644 --- a/src/libstore/export-import.cc +++ b/src/libstore/export-import.cc @@ -64,9 +64,7 @@ StorePaths Store::importPaths(Source & source, CheckSigsFlag checkSigs) /* Extract the NAR from the source. */ StringSink saved; - TeeSource tee { source, saved }; - ParseSink ether; - parseDump(ether, tee); + copyNAR(source, saved); uint32_t magic = readInt(source); if (magic != exportMagic) |