Skip to content

Commit c7b61f3

Browse files
authored
Merge pull request #14631 from obsidiansystems/use-serialisation-abstraction
Use `WorkerProto::Serialise` abstraction for `DrvOutput`
2 parents 487c6b6 + d689b76 commit c7b61f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libstore/daemon.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ static void performOp(
964964
case WorkerProto::Op::RegisterDrvOutput: {
965965
logger->startWork();
966966
if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) {
967-
auto outputId = DrvOutput::parse(readString(conn.from));
967+
auto outputId = WorkerProto::Serialise<DrvOutput>::read(*store, rconn);
968968
auto outputPath = StorePath(readString(conn.from));
969969
store->registerDrvOutput(Realisation{{.outPath = outputPath}, outputId});
970970
} else {
@@ -977,7 +977,7 @@ static void performOp(
977977

978978
case WorkerProto::Op::QueryRealisation: {
979979
logger->startWork();
980-
auto outputId = DrvOutput::parse(readString(conn.from));
980+
auto outputId = WorkerProto::Serialise<DrvOutput>::read(*store, rconn);
981981
auto info = store->queryRealisation(outputId);
982982
logger->stopWork();
983983
if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) {

src/libstore/remote-store.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ void RemoteStore::registerDrvOutput(const Realisation & info)
493493
auto conn(getConnection());
494494
conn->to << WorkerProto::Op::RegisterDrvOutput;
495495
if (GET_PROTOCOL_MINOR(conn->protoVersion) < 31) {
496-
conn->to << info.id.to_string();
496+
WorkerProto::write(*this, *conn, info.id);
497497
conn->to << std::string(info.outPath.to_string());
498498
} else {
499499
WorkerProto::write(*this, *conn, info);
@@ -513,7 +513,7 @@ void RemoteStore::queryRealisationUncached(
513513
}
514514

515515
conn->to << WorkerProto::Op::QueryRealisation;
516-
conn->to << id.to_string();
516+
WorkerProto::write(*this, *conn, id);
517517
conn.processStderr();
518518

519519
auto real = [&]() -> std::shared_ptr<const UnkeyedRealisation> {

0 commit comments

Comments
 (0)