1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

WIP systematize more of the worker protocol

This refactor should *not* change the wire protocol.
This commit is contained in:
John Ericson 2020-08-04 19:02:05 +00:00
parent fbeb8695fb
commit 2f2ae993dc
9 changed files with 132 additions and 135 deletions

View file

@ -107,7 +107,7 @@ struct LegacySSHStore : public Store
auto deriver = readString(conn->from);
if (deriver != "")
info->deriver = parseStorePath(deriver);
info->references = readStorePaths<StorePathSet>(*this, conn->from);
info->references = read(*this, conn->from, Proxy<StorePathSet> {});
readLongLong(conn->from); // download size
info->narSize = readLongLong(conn->from);
@ -139,7 +139,7 @@ struct LegacySSHStore : public Store
<< printStorePath(info.path)
<< (info.deriver ? printStorePath(*info.deriver) : "")
<< info.narHash->to_string(Base16, false);
writeStorePaths(*this, conn->to, info.references);
write(*this, conn->to, info.references);
conn->to
<< info.registrationTime
<< info.narSize
@ -168,7 +168,7 @@ struct LegacySSHStore : public Store
conn->to
<< exportMagic
<< printStorePath(info.path);
writeStorePaths(*this, conn->to, info.references);
write(*this, conn->to, info.references);
conn->to
<< (info.deriver ? printStorePath(*info.deriver) : "")
<< 0
@ -251,10 +251,10 @@ struct LegacySSHStore : public Store
conn->to
<< cmdQueryClosure
<< includeOutputs;
writeStorePaths(*this, conn->to, paths);
write(*this, conn->to, paths);
conn->to.flush();
for (auto & i : readStorePaths<StorePathSet>(*this, conn->from))
for (auto & i : read(*this, conn->from, Proxy<StorePathSet> {}))
out.insert(i);
}
@ -267,10 +267,10 @@ struct LegacySSHStore : public Store
<< cmdQueryValidPaths
<< false // lock
<< maybeSubstitute;
writeStorePaths(*this, conn->to, paths);
write(*this, conn->to, paths);
conn->to.flush();
return readStorePaths<StorePathSet>(*this, conn->from);
return read(*this, conn->from, Proxy<StorePathSet> {});
}
void connect() override