diff options
| author | Stefan Boberg <[email protected]> | 2021-09-06 09:21:49 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-06 09:21:49 +0200 |
| commit | ede0a896160a6c0ef36c289882576ca3c9761244 (patch) | |
| tree | 1dfa46b7b05381e1227f1cfed8988e35d6618e10 /zenserver/compute/apply.cpp | |
| parent | HTTP package handling updated (not final) (diff) | |
| download | zen-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.cpp | 12 |
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; } } |