Use ServeProto::Serialise<UnkeyedValidPathInfo>
for QueryValidPaths
Companion to already-merged https://github.com/NixOS/nix/pull/9560
This commit is contained in:
parent
3f932a6731
commit
d0d3b0a298
@ -338,23 +338,10 @@ static std::map<StorePath, UnkeyedValidPathInfo> queryPathInfos(
|
|||||||
while (true) {
|
while (true) {
|
||||||
auto storePathS = readString(conn.from);
|
auto storePathS = readString(conn.from);
|
||||||
if (storePathS == "") break;
|
if (storePathS == "") break;
|
||||||
auto deriver = readString(conn.from); // deriver
|
|
||||||
auto references = ServeProto::Serialise<StorePathSet>::read(localStore, conn);
|
auto storePath = localStore.parseStorePath(storePathS);
|
||||||
readLongLong(conn.from); // download size
|
auto info = ServeProto::Serialise<UnkeyedValidPathInfo>::read(localStore, conn);
|
||||||
auto narSize = readLongLong(conn.from);
|
infos.insert_or_assign(storePath, info);
|
||||||
auto narHash = Hash::parseAny(readString(conn.from), HashAlgorithm::SHA256);
|
|
||||||
auto ca = ContentAddress::parseOpt(readString(conn.from));
|
|
||||||
readStrings<StringSet>(conn.from); // sigs
|
|
||||||
ValidPathInfo info(localStore.parseStorePath(storePathS), narHash);
|
|
||||||
assert(outputs.count(info.path));
|
|
||||||
info.references = references;
|
|
||||||
info.narSize = narSize;
|
|
||||||
totalNarSize += info.narSize;
|
|
||||||
info.narHash = narHash;
|
|
||||||
info.ca = ca;
|
|
||||||
if (deriver != "")
|
|
||||||
info.deriver = localStore.parseStorePath(deriver);
|
|
||||||
infos.insert_or_assign(info.path, info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return infos;
|
return infos;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user