aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cas.cpp
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
committerLiam Mitchell <[email protected]>2026-03-09 19:06:36 -0700
commitd1abc50ee9d4fb72efc646e17decafea741caa34 (patch)
treee4288e00f2f7ca0391b83d986efcb69d3ba66a83 /src/zenstore/cas.cpp
parentAllow requests with invalid content-types unless specified in command line or... (diff)
parentupdated chunk–block analyser (#818) (diff)
downloadzen-d1abc50ee9d4fb72efc646e17decafea741caa34.tar.xz
zen-d1abc50ee9d4fb72efc646e17decafea741caa34.zip
Merge branch 'main' into lm/restrict-content-type
Diffstat (limited to 'src/zenstore/cas.cpp')
-rw-r--r--src/zenstore/cas.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index ed017988f..8855c87d8 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -153,7 +153,10 @@ CasImpl::Initialize(const CidStoreConfiguration& InConfig)
}
for (std::future<void>& Result : Work)
{
- Result.get();
+ if (Result.valid())
+ {
+ Result.get();
+ }
}
}
}
@@ -300,12 +303,12 @@ GetCompactCasResults(CasContainerStrategy& Strategy,
};
static void
-GetFileCasResults(FileCasStrategy& Strategy,
- CasStore::InsertMode Mode,
- std::span<IoBuffer> Data,
- std::span<IoHash> ChunkHashes,
- std::span<size_t> Indexes,
- std::vector<CasStore::InsertResult> Results)
+GetFileCasResults(FileCasStrategy& Strategy,
+ CasStore::InsertMode Mode,
+ std::span<IoBuffer> Data,
+ std::span<IoHash> ChunkHashes,
+ std::span<size_t> Indexes,
+ std::vector<CasStore::InsertResult>& Results)
{
for (size_t Index : Indexes)
{
@@ -426,7 +429,7 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
[&](size_t Index, const IoBuffer& Payload) {
IoBuffer Chunk(Payload);
Chunk.SetContentType(ZenContentType::kCompressedBinary);
- return AsyncCallback(Index, Payload);
+ return AsyncCallback(Index, Chunk);
},
OptionalWorkerPool,
LargeSizeLimit == 0 ? m_Config.HugeValueThreshold : Min(LargeSizeLimit, m_Config.HugeValueThreshold)))
@@ -439,7 +442,7 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
[&](size_t Index, const IoBuffer& Payload) {
IoBuffer Chunk(Payload);
Chunk.SetContentType(ZenContentType::kCompressedBinary);
- return AsyncCallback(Index, Payload);
+ return AsyncCallback(Index, Chunk);
},
OptionalWorkerPool,
LargeSizeLimit == 0 ? m_Config.TinyValueThreshold : Min(LargeSizeLimit, m_Config.TinyValueThreshold)))
@@ -452,7 +455,7 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
[&](size_t Index, const IoBuffer& Payload) {
IoBuffer Chunk(Payload);
Chunk.SetContentType(ZenContentType::kCompressedBinary);
- return AsyncCallback(Index, Payload);
+ return AsyncCallback(Index, Chunk);
},
OptionalWorkerPool))
{
@@ -512,6 +515,8 @@ CreateCasStore(GcManager& Gc)
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.cas");
+
TEST_CASE("CasStore")
{
ScopedTemporaryDirectory TempDir;
@@ -553,6 +558,8 @@ TEST_CASE("CasStore")
CHECK(Lookup2);
}
+TEST_SUITE_END();
+
void
CAS_forcelink()
{