diff options
| author | Stefan Boberg <[email protected]> | 2021-05-13 17:37:32 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-13 17:37:32 +0200 |
| commit | 5d46e91942d81f6ca4d12225757e633013408369 (patch) | |
| tree | d14316239f40078a91cba3d867dddc2b6bec6e2b /zenserver/projectstore.cpp | |
| parent | Added string_view variant of WindowsException constructor (diff) | |
| download | zen-5d46e91942d81f6ca4d12225757e633013408369.tar.xz zen-5d46e91942d81f6ca4d12225757e633013408369.zip | |
Implemented move-in-place for large CAS payloads
Diffstat (limited to 'zenserver/projectstore.cpp')
| -rw-r--r-- | zenserver/projectstore.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zenserver/projectstore.cpp b/zenserver/projectstore.cpp index cb6be69e8..dcad483a6 100644 --- a/zenserver/projectstore.cpp +++ b/zenserver/projectstore.cpp @@ -477,8 +477,8 @@ ProjectStore::Oplog::AppendNewOplogEntry(CbPackage OpPackage) for (const auto& Attach : Attachments) { - SharedBuffer BinaryView = Attach.AsBinaryView(); - m_CasStore.InsertChunk(BinaryView.GetData(), BinaryView.GetSize(), Attach.GetHash()); + IoBuffer AttachmentData = Attach.AsBinaryView().AsIoBuffer(); + m_CasStore.InsertChunk(AttachmentData, Attach.GetHash()); } return RegisterOplogEntry(Core, OpEntry, kUpdateNewEntry); @@ -1060,7 +1060,7 @@ HttpProjectService::HttpProjectService(CasStore& Store, ProjectStore* Projects) CbPackage::AttachmentResolver Resolver = [&](const IoHash& Hash) -> SharedBuffer { std::filesystem::path AttachmentPath = Log.TempPath() / Hash.ToHexString(); - if (IoBuffer Data = IoBufferBuilder::MakeFromFile(AttachmentPath.native().c_str())) + if (IoBuffer Data = IoBufferBuilder::MakeFromTemporaryFile(AttachmentPath.native().c_str())) { return SharedBuffer(std::move(Data)); } |