aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-07 12:37:33 +0100
committereldritch horrors <pennae@lix.systems>2024-03-07 12:37:33 +0100
commit8a268359b06471b463a8f3fc46c83a1fced8ab75 (patch)
treeb9a854b5faf432d158a449ec3f14146e4e6db00d /src/nix-store/nix-store.cc
parent9eb58f5209f9cd1fd18f33b691c6a613075dffc4 (diff)
Merge pull request #9560 from obsidiansystems/serve-proto-unkeyed-valid-path-info-serializer
Factor out `ServeProto::Serialiser<UnkeyedValidPathInfo>` and test (cherry picked from commit 139982997eec493a0f74105c427953f6be77da6d) Change-Id: I28e4ba5a681a90d81915a56e6dbaa5456d64f96d
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 79002626d..d53e93b7f 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -891,16 +891,8 @@ static void opServe(Strings opFlags, Strings opArgs)
for (auto & i : paths) {
try {
auto info = store->queryPathInfo(i);
- out << store->printStorePath(info->path)
- << (info->deriver ? store->printStorePath(*info->deriver) : "");
- ServeProto::write(*store, wconn, info->references);
- // !!! Maybe we want compression?
- out << info->narSize // downloadSize
- << info->narSize;
- if (GET_PROTOCOL_MINOR(clientVersion) >= 4)
- out << info->narHash.to_string(Base32, true)
- << renderContentAddress(info->ca)
- << info->sigs;
+ out << store->printStorePath(info->path);
+ ServeProto::write(*store, wconn, static_cast<const UnkeyedValidPathInfo &>(*info));
} catch (InvalidPath &) {
}
}