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