From 20a0857660483e941a0eee44e9a9022556958044 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 30 Oct 2025 14:01:38 -0400 Subject: [PATCH] Revert "Deduplicate protocol code more with `ServeProto::BasicClientConnection`" This reverts commit 58846b0a1c896c55f3897f45b363ad2ba8a53ed5. --- src/hydra-queue-runner/build-remote.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 1489f7d6..4111a8fb 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -104,9 +104,9 @@ static void copyClosureTo( std::unique_lock sendLock(conn.machine->state->sendLock, std::chrono::seconds(600)); - conn.importPaths(destStore, [&](Sink & sink) { - exportPaths(destStore, missing, sink); - }); + conn.to << ServeProto::Command::ImportPaths; + exportPaths(destStore, missing, conn.to); + conn.to.flush(); if (readInt(conn.from) != 1) throw Error("remote machine failed to import closure"); @@ -301,10 +301,11 @@ static void copyPathFromRemote( lambda function only gets executed if someone tries to read from source2, we will send the command from here rather than outside the lambda. */ - conn.narFromPath(localStore, info.path, [&](Source & source) { - TeeSource tee(source, sink); - extractNarData(tee, localStore.printStorePath(info.path), narMembers); - }); + conn.to << ServeProto::Command::DumpStorePath << localStore.printStorePath(info.path); + conn.to.flush(); + + TeeSource tee(conn.from, sink); + extractNarData(tee, localStore.printStorePath(info.path), narMembers); }); destStore.addToStore(info, *source2, NoRepair, NoCheckSigs);