diff options
author | Shea Levy <shea@shealevy.com> | 2014-02-10T11·52-0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2014-02-10T11·52-0500 |
commit | 38c3beac1a8ac9ddf4fdbbcafd400dabcf195076 (patch) | |
tree | e6b1d1f111c18d9d01a9ffa401d0e93568fa01ed /src/libstore/store-api.cc | |
parent | 16146031659eae475cd5933b8553b13d725ca436 (diff) |
Move StoreApi::serve into opServe
Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index e4f180240992..0f250a3c7c04 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1,7 +1,6 @@ #include "store-api.hh" #include "globals.hh" #include "util.hh" -#include "archive.hh" #include <climits> @@ -259,39 +258,6 @@ string StoreAPI::makeValidityRegistration(const PathSet & paths, } -void StoreAPI::serve(Source & in, BufferedSink & out) -{ - string cmd = readString(in); - if (cmd == "query") { - for (cmd = readString(in); !cmd.empty(); cmd = readString(in)) { - PathSet paths = readStrings<PathSet>(in); - if (cmd == "have") { - writeStrings(queryValidPaths(paths), out); - } else if (cmd == "info") { - // !!! Maybe we want a queryPathInfos? - foreach (PathSet::iterator, i, paths) { - if (!isValidPath(*i)) - continue; - ValidPathInfo info = queryPathInfo(*i); - writeString(info.path, out); - writeString(info.deriver, out); - writeStrings(info.references, out); - // !!! Maybe we want compression? - writeLongLong(info.narSize, out); // downloadSize - writeLongLong(info.narSize, out); - } - writeString("", out); - } else - throw Error(format("Unknown serve query `%1%'") % cmd); - out.flush(); - } - } else if (cmd == "substitute") - dumpPath(readString(in), out); - else - throw Error(format("Unknown serve command `%1%'") % cmd); -} - - ValidPathInfo decodeValidPathInfo(std::istream & str, bool hashGiven) { ValidPathInfo info; |