aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore')
-rw-r--r--src/zenstore/cas.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index 26ec2b10d..45d7dd277 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -365,16 +365,19 @@ CasImpl::FindChunk(const IoHash& ChunkHash)
if (IoBuffer Found = m_SmallStrategy.FindChunk(ChunkHash))
{
+ Found.SetContentType(ZenContentType::kCompressedBinary);
return Found;
}
if (IoBuffer Found = m_TinyStrategy.FindChunk(ChunkHash))
{
+ Found.SetContentType(ZenContentType::kCompressedBinary);
return Found;
}
if (IoBuffer Found = m_LargeStrategy.FindChunk(ChunkHash))
{
+ Found.SetContentType(ZenContentType::kCompressedBinary);
return Found;
}
@@ -405,15 +408,33 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
WorkerThreadPool* OptionalWorkerPool)
{
ZEN_TRACE_CPU("CAS::IterateChunks");
- if (!m_SmallStrategy.IterateChunks(DecompressedIds, AsyncCallback, OptionalWorkerPool))
+ if (!m_SmallStrategy.IterateChunks(
+ DecompressedIds,
+ [&](size_t Index, const IoBuffer& Payload) {
+ IoBuffer Chunk(Payload);
+ Chunk.SetContentType(ZenContentType::kCompressedBinary);
+ return AsyncCallback(Index, Payload);
+ },
+ OptionalWorkerPool))
{
return false;
}
- if (!m_TinyStrategy.IterateChunks(DecompressedIds, AsyncCallback, OptionalWorkerPool))
+ if (!m_TinyStrategy.IterateChunks(
+ DecompressedIds,
+ [&](size_t Index, const IoBuffer& Payload) {
+ IoBuffer Chunk(Payload);
+ Chunk.SetContentType(ZenContentType::kCompressedBinary);
+ return AsyncCallback(Index, Payload);
+ },
+ OptionalWorkerPool))
{
return false;
}
- if (!m_LargeStrategy.IterateChunks(DecompressedIds, AsyncCallback))
+ if (!m_LargeStrategy.IterateChunks(DecompressedIds, [&](size_t Index, const IoBuffer& Payload) {
+ IoBuffer Chunk(Payload);
+ Chunk.SetContentType(ZenContentType::kCompressedBinary);
+ return AsyncCallback(Index, Payload);
+ }))
{
return false;
}