1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

Update worker protocol to support sending storepath maps

We need to also send the ca to daemon in addition to the path.
This commit is contained in:
Matthew Bauer 2020-06-19 18:06:19 -04:00
parent e8e1f5282f
commit f2a6cee334
3 changed files with 40 additions and 9 deletions

View file

@ -609,12 +609,15 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
}
case wopQuerySubstitutablePathInfos: {
auto paths = readStorePaths<StorePathSet>(*store, from);
logger->startWork();
SubstitutablePathInfos infos;
StorePathCAMap pathsMap = {};
for (auto & path : paths)
pathsMap.emplace(path, std::nullopt);
if (GET_PROTOCOL_MINOR(clientVersion) < 22) {
auto paths = readStorePaths<StorePathSet>(*store, from);
for (auto & path : paths)
pathsMap.emplace(path, std::nullopt);
} else
pathsMap = readStorePathCAMap(*store, from);
logger->startWork();
store->querySubstitutablePathInfos(pathsMap, infos);
logger->stopWork();
to << infos.size();