1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 23:42:43 +01:00

WIP: Put the worker protocol read and write in a namespace to disambig

This commit is contained in:
John Ericson 2020-08-05 20:37:48 +00:00
parent ed96e603e1
commit 6c66331d5c
2 changed files with 16 additions and 5 deletions

View file

@ -58,6 +58,8 @@ void writeStorePathCAMap(const Store & store, Sink & out, const StorePathCAMap &
}
namespace worker_proto {
StorePath read(const Store & store, Source & from, Phantom<StorePath> _)
{
return store.parseStorePath(readString(from));
@ -68,6 +70,8 @@ void write(const Store & store, Sink & out, const StorePath & storePath)
out << store.printStorePath(storePath);
}
}
/* TODO: Separate these store impls into different files, give them better names */
RemoteStore::RemoteStore(const Params & params)
@ -461,7 +465,7 @@ std::map<std::string, std::optional<StorePath>> RemoteStore::queryDerivationOutp
auto conn(getConnection());
conn->to << wopQueryDerivationOutputMap << printStorePath(path);
conn.processStderr();
return read(*this, conn->from, Phantom<std::map<std::string, std::optional<StorePath>>> {});
return worker_proto::read(*this, conn->from, Phantom<std::map<std::string, std::optional<StorePath>>> {});
}