about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/remote-store.cc7
-rw-r--r--src/libstore/worker-protocol.hh3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 232f62e7ab6d..f03f33fc175c 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -345,7 +345,12 @@ Path RemoteStore::queryPathFromHashPart(const string & hashPart)
 void RemoteStore::addToStore(const ValidPathInfo & info, const std::string & nar,
     bool repair, bool dontCheckSigs)
 {
-    throw Error("RemoteStore::addToStore() not implemented");
+    auto conn(connections->get());
+    conn->to << wopAddToStoreNar
+             << info.path << info.deriver << printHash(info.narHash)
+             << info.references << info.registrationTime << info.narSize
+             << info.ultimate << info.sigs << nar << repair << dontCheckSigs;
+    conn->processStderr();
 }
 
 
diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh
index c7f024efe749..2cd246dab5df 100644
--- a/src/libstore/worker-protocol.hh
+++ b/src/libstore/worker-protocol.hh
@@ -46,7 +46,8 @@ typedef enum {
     wopVerifyStore = 35,
     wopBuildDerivation = 36,
     wopAddSignatures = 37,
-    wopNarFromPath = 38
+    wopNarFromPath = 38,
+    wopAddToStoreNar = 39
 } WorkerOp;