aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/export-import.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-17 13:40:46 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-06-19 12:08:23 -0400
commit9f69b7dee9fc6035b8aa0cc718f5e74af460d9aa (patch)
tree167c44235e63dd0ed73b7ee3497ee04ecccfda86 /src/libstore/export-import.cc
parent4e8b495ad7dddabc35bf9d6afe3573426ffed15d (diff)
Create `worker_proto::{Read,Write}Conn`
Pass this around instead of `Source &` and `Sink &` directly. This will give us something to put the protocol version on once the time comes. To do this ergonomically, we need to expose `RemoteStore::Connection`, so do that too. Give it some more API docs while we are at it.
Diffstat (limited to 'src/libstore/export-import.cc')
-rw-r--r--src/libstore/export-import.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc
index b4100bace..e866aeb42 100644
--- a/src/libstore/export-import.cc
+++ b/src/libstore/export-import.cc
@@ -46,7 +46,9 @@ void Store::exportPath(const StorePath & path, Sink & sink)
teeSink
<< exportMagic
<< printStorePath(path);
- WorkerProto::write(*this, teeSink, info->references);
+ WorkerProto::write(*this,
+ WorkerProto::WriteConn { .to = teeSink },
+ info->references);
teeSink
<< (info->deriver ? printStorePath(*info->deriver) : "")
<< 0;
@@ -74,7 +76,8 @@ StorePaths Store::importPaths(Source & source, CheckSigsFlag checkSigs)
//Activity act(*logger, lvlInfo, "importing path '%s'", info.path);
- auto references = WorkerProto::Serialise<StorePathSet>::read(*this, source);
+ auto references = WorkerProto::Serialise<StorePathSet>::read(*this,
+ WorkerProto::ReadConn { .from = source });
auto deriver = readString(source);
auto narHash = hashString(htSHA256, saved.s);