aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/daemon.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-24 15:24:02 +0100
committereldritch horrors <pennae@lix.systems>2024-03-24 15:24:02 +0100
commit3e428f2289d0cb1277e013cd7f37754d7c533ddf (patch)
tree881616480ec1a57e449e7604f2b73e6438e7e397 /src/libstore/daemon.cc
parent946fc12e4e6d7e097c5b6ed4f6bc4d516b10b901 (diff)
libstore: un-inline copyNAR expansions
these are copies of copyNAR with only some variables renamed. Change-Id: I98ddd7a98250fa5d304e18e1debf417e9f7768dd
Diffstat (limited to 'src/libstore/daemon.cc')
-rw-r--r--src/libstore/daemon.cc8
1 files changed, 2 insertions, 6 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);
}