diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-01 16:40:32 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-01 16:40:32 -0400 |
commit | eeecfacb439b06b89977b55c879d74da85387a36 (patch) | |
tree | d83d5d4227c485a06cf219889cc928b0bd3832a1 /src/libstore/daemon.cc | |
parent | 1f8e1edba9520f35bb69961859b77e072f35e8c1 (diff) | |
parent | c51d554c933b5fe294da41fcdf5afe0d4f33f586 (diff) |
Merge branch 'path-info' into ca-drv-exotic
Diffstat (limited to 'src/libstore/daemon.cc')
-rw-r--r-- | src/libstore/daemon.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 7cb378e12..0e2169035 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -401,12 +401,12 @@ static void performOp(TunnelLogger * logger, ref<Store> store, logger->startWork(); auto pathInfo = [&]() { // NB: FramedSource must be out of scope before logger->stopWork(); - auto [contentAddressMethod, hashType_] = parseContentAddressMethod(camStr); + auto [contentAddressMethod, hashType_] = ContentAddressMethod::parse(camStr); auto hashType = hashType_; // work around clang bug FramedSource source(from); // TODO this is essentially RemoteStore::addCAToStore. Move it up to Store. return std::visit(overloaded { - [&](TextHashMethod &) { + [&](const TextHashMethod &) { if (hashType != htSHA256) throw UnimplementedError("Only SHA-256 is supported for adding text-hashed data, but '%1' was given", printHashType(hashType)); @@ -415,11 +415,11 @@ static void performOp(TunnelLogger * logger, ref<Store> store, auto path = store->addTextToStore(name, contents, refs, repair); return store->queryPathInfo(path); }, - [&](FileIngestionMethod & fim) { + [&](const FileIngestionMethod & fim) { auto path = store->addToStoreFromDump(source, name, fim, hashType, repair, refs); return store->queryPathInfo(path); }, - }, contentAddressMethod); + }, contentAddressMethod.raw); }(); logger->stopWork(); @@ -884,7 +884,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store, info.references = worker_proto::read(*store, from, Phantom<StorePathSet> {}); from >> info.registrationTime >> info.narSize >> info.ultimate; info.sigs = readStrings<StringSet>(from); - info.ca = parseContentAddressOpt(readString(from)); + info.ca = ContentAddress::parseOpt(readString(from)); from >> repair >> dontCheckSigs; if (!trusted && dontCheckSigs) dontCheckSigs = false; |