aboutsummaryrefslogtreecommitdiff
path: root/zenserver/compute/apply.cpp
diff options
context:
space:
mode:
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 ff90be9ec..939ac3362 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;
}
}