@@ -103,9 +103,9 @@ static void copyClosureTo(
103103 std::unique_lock<std::timed_mutex> sendLock (conn.machine ->state ->sendLock ,
104104 std::chrono::seconds (600 ));
105105
106- conn.to << ServeProto::Command::ImportPaths;
107- destStore.exportPaths (missing, conn. to );
108- conn. to . flush ( );
106+ conn.importPaths (destStore, [&](Sink & sink) {
107+ destStore.exportPaths (missing, sink );
108+ } );
109109
110110 if (readInt (conn.from ) != 1 )
111111 throw Error (" remote machine failed to import closure" );
@@ -298,11 +298,10 @@ static void copyPathFromRemote(
298298 lambda function only gets executed if someone tries to read
299299 from source2, we will send the command from here rather
300300 than outside the lambda. */
301- conn.to << ServeProto::Command::DumpStorePath << localStore.printStorePath (info.path );
302- conn.to .flush ();
303-
304- TeeSource tee (conn.from , sink);
305- extractNarData (tee, localStore.printStorePath (info.path ), narMembers);
301+ conn.narFromPath (localStore, info.path , [&](Source & source) {
302+ TeeSource tee (source, sink);
303+ extractNarData (tee, localStore.printStorePath (info.path ), narMembers);
304+ });
306305 });
307306
308307 destStore.addToStore (info, *source2, NoRepair, NoCheckSigs);
0 commit comments