aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cache/cacherpc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/cache/cacherpc.cpp')
-rw-r--r--src/zenstore/cache/cacherpc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zenstore/cache/cacherpc.cpp b/src/zenstore/cache/cacherpc.cpp
index e4f23816d..fdee017e0 100644
--- a/src/zenstore/cache/cacherpc.cpp
+++ b/src/zenstore/cache/cacherpc.cpp
@@ -1823,7 +1823,9 @@ CacheRpcHandler::GetLocalCacheValues(const CacheRequestContext& Context,
ChunkRequest* Request = ValueRequests[RequestIndex];
if (Chunks[RequestIndex].Value)
{
- if (IsCompressedBinary(Chunks[RequestIndex].Value.GetContentType()))
+ // If the request included a raw hash, only offer a result if the RawHash matched what we found in storage
+ if (IsCompressedBinary(Chunks[RequestIndex].Value.GetContentType()) &&
+ ((Request->Key->ChunkId == IoHash::Zero) || (Request->Key->ChunkId == Chunks[RequestIndex].RawHash)))
{
Request->Key->ChunkId = Chunks[RequestIndex].RawHash;
Request->Exists = true;