aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/legacy-ssh-store.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-05-26 11:07:25 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-06-19 12:08:23 -0400
commit95eae0c002da5ef35e583b46a67818ebb95d3a1e (patch)
tree5ffdafd07c800bf91f6e3eca6f922bc1549b2cc8 /src/libstore/legacy-ssh-store.cc
parent469d06f9bc9b2543f48d8e633e47f9344fba35ab (diff)
Put worker protocol items inside a `WorkerProto` struct
See API docs on that struct for why. The pasing as as template argument doesn't yet happen in that commit, but will instead happen in later commit. Also make `WorkerOp` (now `Op`) and enum struct. This led us to catch that two operations were not handled! Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Diffstat (limited to 'src/libstore/legacy-ssh-store.cc')
-rw-r--r--src/libstore/legacy-ssh-store.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc
index bff024f96..7d006f451 100644
--- a/src/libstore/legacy-ssh-store.cc
+++ b/src/libstore/legacy-ssh-store.cc
@@ -147,7 +147,7 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
auto deriver = readString(conn->from);
if (deriver != "")
info->deriver = parseStorePath(deriver);
- info->references = WorkerProto<StorePathSet>::read(*this, conn->from);
+ info->references = WorkerProto::Serialise<StorePathSet>::read(*this, conn->from);
readLongLong(conn->from); // download size
info->narSize = readLongLong(conn->from);
@@ -181,7 +181,7 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
<< printStorePath(info.path)
<< (info.deriver ? printStorePath(*info.deriver) : "")
<< info.narHash.to_string(Base16, false);
- workerProtoWrite(*this, conn->to, info.references);
+ WorkerProto::write(*this, conn->to, info.references);
conn->to
<< info.registrationTime
<< info.narSize
@@ -210,7 +210,7 @@ struct LegacySSHStore : public virtual LegacySSHStoreConfig, public virtual Stor
conn->to
<< exportMagic
<< printStorePath(info.path);
- workerProtoWrite(*this, conn->to, info.references);
+ WorkerProto::write(*this, conn->to, info.references);
conn->to
<< (info.deriver ? printStorePath(*info.deriver) : "")
<< 0
@@ -295,7 +295,7 @@ public:
if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 3)
conn->from >> status.timesBuilt >> status.isNonDeterministic >> status.startTime >> status.stopTime;
if (GET_PROTOCOL_MINOR(conn->remoteVersion) >= 6) {
- auto builtOutputs = WorkerProto<DrvOutputs>::read(*this, conn->from);
+ auto builtOutputs = WorkerProto::Serialise<DrvOutputs>::read(*this, conn->from);
for (auto && [output, realisation] : builtOutputs)
status.builtOutputs.insert_or_assign(
std::move(output.outputName),
@@ -370,10 +370,10 @@ public:
conn->to
<< cmdQueryClosure
<< includeOutputs;
- workerProtoWrite(*this, conn->to, paths);
+ WorkerProto::write(*this, conn->to, paths);
conn->to.flush();
- for (auto & i : WorkerProto<StorePathSet>::read(*this, conn->from))
+ for (auto & i : WorkerProto::Serialise<StorePathSet>::read(*this, conn->from))
out.insert(i);
}
@@ -386,10 +386,10 @@ public:
<< cmdQueryValidPaths
<< false // lock
<< maybeSubstitute;
- workerProtoWrite(*this, conn->to, paths);
+ WorkerProto::write(*this, conn->to, paths);
conn->to.flush();
- return WorkerProto<StorePathSet>::read(*this, conn->from);
+ return WorkerProto::Serialise<StorePathSet>::read(*this, conn->from);
}
void connect() override