aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/cache/cacherequests.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-03-22 23:00:54 +0100
committerGitHub Enterprise <[email protected]>2024-03-22 23:00:54 +0100
commit5e02fc9fa0a2480e608a72489baef5831b099460 (patch)
tree8004ef01ef36c61aeb1223a499e14808469113e7 /src/zenutil/cache/cacherequests.cpp
parent5.4.2-pre7 (diff)
downloadzen-5.4.2-pre10.tar.xz
zen-5.4.2-pre10.zip
re-enable partial cache chunks (#21)v5.4.2-pre9v5.4.2-pre12v5.4.2-pre11v5.4.2-pre10
* Separate chunk raw hash from section hash (how to find the fragment attachment) * fix partial get cache value tests
Diffstat (limited to 'src/zenutil/cache/cacherequests.cpp')
-rw-r--r--src/zenutil/cache/cacherequests.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/zenutil/cache/cacherequests.cpp b/src/zenutil/cache/cacherequests.cpp
index 442cf0dfc..7c6f493f2 100644
--- a/src/zenutil/cache/cacherequests.cpp
+++ b/src/zenutil/cache/cacherequests.cpp
@@ -792,9 +792,11 @@ namespace cacherequests {
bool Succeeded = !RawHashField.HasError();
if (Succeeded)
{
- ValueResult.RawOffset = RecordObject["RawOffset"].AsUInt64(0);
- const CbAttachment* Attachment = Package.FindAttachment(ValueResult.RawHash);
- ValueResult.Body = Attachment ? Attachment->AsCompressedBinary().MakeOwned() : CompressedBuffer();
+ ValueResult.FragmentOffset = RecordObject["FragmentOffset"].AsUInt64(0);
+ ValueResult.FragmentHash = RecordObject["FragmentHash"].AsHash();
+ const CbAttachment* Attachment =
+ Package.FindAttachment(ValueResult.FragmentHash == IoHash::Zero ? ValueResult.RawHash : ValueResult.FragmentHash);
+ ValueResult.Body = Attachment ? Attachment->AsCompressedBinary().MakeOwned() : CompressedBuffer();
if (ValueResult.Body)
{
ValueResult.RawSize = ValueResult.Body.DecodeRawSize();