aboutsummaryrefslogtreecommitdiff
path: root/zenserver/compute/apply.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-06 09:21:49 +0200
committerStefan Boberg <[email protected]>2021-09-06 09:21:49 +0200
commitede0a896160a6c0ef36c289882576ca3c9761244 (patch)
tree1dfa46b7b05381e1227f1cfed8988e35d6618e10 /zenserver/compute/apply.cpp
parentHTTP package handling updated (not final) (diff)
downloadzen-ede0a896160a6c0ef36c289882576ca3c9761244.tar.xz
zen-ede0a896160a6c0ef36c289882576ca3c9761244.zip
Changed so function service commits compressed buffers
Diffstat (limited to 'zenserver/compute/apply.cpp')
-rw-r--r--zenserver/compute/apply.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/zenserver/compute/apply.cpp b/zenserver/compute/apply.cpp
index c3d8c01ab..9e6beffe3 100644
--- a/zenserver/compute/apply.cpp
+++ b/zenserver/compute/apply.cpp
@@ -428,17 +428,19 @@ HttpFunctionService::HttpFunctionService(CasStore& Store, CidStore& InCidStore,
{
ZEN_ASSERT(Attachment.IsBinary());
- const IoHash DataHash = Attachment.GetHash();
- SharedBuffer DataView = Attachment.AsBinary();
+ const IoHash DataHash = Attachment.GetHash();
+ CompressedBuffer DataView = Attachment.AsCompressedBinary();
- TotalAttachmentBytes += DataView.GetSize();
+ TotalAttachmentBytes += DataView.GetCompressedSize();
++AttachmentCount;
- CasStore::InsertResult InsertResult = m_CasStore.InsertChunk(DataView.AsIoBuffer(), DataHash);
+ IoBuffer Payload = DataView.GetCompressed().Flatten().AsIoBuffer();
+
+ CasStore::InsertResult InsertResult = m_CasStore.InsertChunk(Payload, DataHash);
if (InsertResult.New)
{
- TotalNewBytes += DataView.GetSize();
+ TotalNewBytes += Payload.Size();
++NewAttachmentCount;
}
}