about summary refs log tree commit diff
path: root/src/download-via-ssh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-14T11·31+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-14T11·31+0100
commita9d99ab55fdaa1c9dde87eaa8d289ecdb8cf9068 (patch)
tree8c6a679c49e3f2e78e74e3280f880e88b36c11af /src/download-via-ssh
parent4db572062ccf318a6524abb8da046592a570eb94 (diff)
download-via-ssh: Use readStorePath
Diffstat (limited to 'src/download-via-ssh')
-rw-r--r--src/download-via-ssh/download-via-ssh.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/download-via-ssh/download-via-ssh.cc b/src/download-via-ssh/download-via-ssh.cc
index 86cbb20573..6361e71e99 100644
--- a/src/download-via-ssh/download-via-ssh.cc
+++ b/src/download-via-ssh/download-via-ssh.cc
@@ -5,6 +5,8 @@
 #include "affinity.hh"
 #include "globals.hh"
 #include "serve-protocol.hh"
+#include "worker-protocol.hh"
+#include "store-api.hh"
 
 #include <iostream>
 #include <unistd.h>
@@ -82,10 +84,15 @@ static void query(std::pair<FdSink, FdSource> & pipes)
             writeInt(qCmdInfo, pipes.first);
             writeStrings(tokenized, pipes.first);
             pipes.first.flush();
-            for (Path path = readString(pipes.second); !path.empty(); path = readString(pipes.second)) {
+            while (1) {
+                Path path = readString(pipes.second);
+                if (path.empty()) break;
+                assertStorePath(path);
                 std::cout << path << std::endl;
-                std::cout << readString(pipes.second) << std::endl;
-                PathSet references = readStrings<PathSet>(pipes.second);
+                string deriver = readString(pipes.second);
+                if (!deriver.empty()) assertStorePath(deriver);
+                std::cout << deriver << std::endl;
+                PathSet references = readStorePaths<PathSet>(pipes.second);
                 std::cout << references.size() << std::endl;
                 foreach (PathSet::iterator, i, references)
                     std::cout << *i << std::endl;