diff options
| author | Per Larsson <[email protected]> | 2022-01-11 13:28:26 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2022-01-11 13:28:26 +0100 |
| commit | b53b27a027a1f891396278fe4d139424def374e0 (patch) | |
| tree | f78a58527b18b98925df723a72fd4bb527fc4e73 /zenserver/cache/structuredcache.cpp | |
| parent | Merged main. (diff) | |
| download | zen-b53b27a027a1f891396278fe4d139424def374e0.tar.xz zen-b53b27a027a1f891396278fe4d139424def374e0.zip | |
Fixed missing content type when storing cache values.
Diffstat (limited to 'zenserver/cache/structuredcache.cpp')
| -rw-r--r-- | zenserver/cache/structuredcache.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp index ef312d800..4397e3723 100644 --- a/zenserver/cache/structuredcache.cpp +++ b/zenserver/cache/structuredcache.cpp @@ -7,12 +7,12 @@ #include <zencore/compactbinarypackage.h> #include <zencore/compactbinaryvalidation.h> #include <zencore/compress.h> -#include <zencore/trace.h> #include <zencore/fmtutils.h> #include <zencore/logging.h> #include <zencore/scopeguard.h> #include <zencore/stream.h> #include <zencore/timer.h> +#include <zencore/trace.h> #include <zenhttp/httpserver.h> #include <zenstore/cas.h> #include <zenutil/cache/cache.h> @@ -556,10 +556,11 @@ HttpStructuredCacheService::HandlePutCacheRecord(zen::HttpServerRequest& Request Count.Valid, Count.Total); - IoBuffer CacheRecordValue = CacheRecord.GetBuffer().AsIoBuffer(); - CacheRecordValue.SetContentType(ZenContentType::kCbObject); + ZenCacheValue CacheValue; + CacheValue.Value = CacheRecord.GetBuffer().AsIoBuffer(); + CacheValue.Value.SetContentType(ZenContentType::kCbObject); - m_CacheStore.Put(Ref.BucketSegment, Ref.HashKey, {.Value = CacheRecord.GetBuffer().AsIoBuffer()}); + m_CacheStore.Put(Ref.BucketSegment, Ref.HashKey, CacheValue); const bool IsPartialRecord = Count.Valid != Count.Total; @@ -610,8 +611,8 @@ HttpStructuredCacheService::HandleGetCachePayload(zen::HttpServerRequest& Reques { if (CompressedBuffer Compressed = CompressedBuffer::FromCompressed(SharedBuffer(UpstreamResult.Value))) { - /*CidStore::InsertResult Result =*/ m_CidStore.AddChunk(Compressed); - InUpstreamCache = true; + m_CidStore.AddChunk(Compressed); + InUpstreamCache = true; } else { @@ -666,7 +667,6 @@ HttpStructuredCacheService::HandlePutCachePayload(zen::HttpServerRequest& Reques Body.SetContentType(Request.RequestContentType()); - /*IoHash ChunkHash =*/ IoHash::HashBuffer(Body); CompressedBuffer Compressed = CompressedBuffer::FromCompressed(SharedBuffer(Body)); if (!Compressed) |