diff options
| author | Dan Engelbrecht <[email protected]> | 2024-03-22 23:00:54 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-03-22 23:00:54 +0100 |
| commit | 5e02fc9fa0a2480e608a72489baef5831b099460 (patch) | |
| tree | 8004ef01ef36c61aeb1223a499e14808469113e7 /src/zenutil/cache/cacherequests.cpp | |
| parent | 5.4.2-pre7 (diff) | |
| download | zen-5e02fc9fa0a2480e608a72489baef5831b099460.tar.xz zen-5e02fc9fa0a2480e608a72489baef5831b099460.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.cpp | 8 |
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(); |