mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 19:51:00 +01:00
Use WorkerProto::Serialise abstraction for DrvOutput
It's better to consistently use the abstraction, rather than code which
happens to do the same thing.
See also d782c5e586 for the same sort of
change.
This commit is contained in:
parent
487c6b6c46
commit
d689b764f3
2 changed files with 4 additions and 4 deletions
|
|
@ -964,7 +964,7 @@ static void performOp(
|
|||
case WorkerProto::Op::RegisterDrvOutput: {
|
||||
logger->startWork();
|
||||
if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) {
|
||||
auto outputId = DrvOutput::parse(readString(conn.from));
|
||||
auto outputId = WorkerProto::Serialise<DrvOutput>::read(*store, rconn);
|
||||
auto outputPath = StorePath(readString(conn.from));
|
||||
store->registerDrvOutput(Realisation{{.outPath = outputPath}, outputId});
|
||||
} else {
|
||||
|
|
@ -977,7 +977,7 @@ static void performOp(
|
|||
|
||||
case WorkerProto::Op::QueryRealisation: {
|
||||
logger->startWork();
|
||||
auto outputId = DrvOutput::parse(readString(conn.from));
|
||||
auto outputId = WorkerProto::Serialise<DrvOutput>::read(*store, rconn);
|
||||
auto info = store->queryRealisation(outputId);
|
||||
logger->stopWork();
|
||||
if (GET_PROTOCOL_MINOR(conn.protoVersion) < 31) {
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ void RemoteStore::registerDrvOutput(const Realisation & info)
|
|||
auto conn(getConnection());
|
||||
conn->to << WorkerProto::Op::RegisterDrvOutput;
|
||||
if (GET_PROTOCOL_MINOR(conn->protoVersion) < 31) {
|
||||
conn->to << info.id.to_string();
|
||||
WorkerProto::write(*this, *conn, info.id);
|
||||
conn->to << std::string(info.outPath.to_string());
|
||||
} else {
|
||||
WorkerProto::write(*this, *conn, info);
|
||||
|
|
@ -513,7 +513,7 @@ void RemoteStore::queryRealisationUncached(
|
|||
}
|
||||
|
||||
conn->to << WorkerProto::Op::QueryRealisation;
|
||||
conn->to << id.to_string();
|
||||
WorkerProto::write(*this, *conn, id);
|
||||
conn.processStderr();
|
||||
|
||||
auto real = [&]() -> std::shared_ptr<const UnkeyedRealisation> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue