diff options
| author | Stefan Boberg <[email protected]> | 2025-01-29 15:08:03 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2025-01-29 15:08:03 +0100 |
| commit | e64c8727ecb073ca03e2c7d4b3972c375c1b6315 (patch) | |
| tree | 04a1a7c178c43666de7f7f9b472ed156f6373da5 /src/zenserver/projectstore/httpprojectstore.cpp | |
| parent | Merge branch 'main' of https://github.ol.epicgames.net/ue-foundation/zen (diff) | |
| parent | handle special backslash followed by quote for paths (#279) (diff) | |
| download | zen-sb/cleanup-main.tar.xz zen-sb/cleanup-main.zip | |
Merge branch 'main' of https://github.ol.epicgames.net/ue-foundation/zensb/cleanup-main
Diffstat (limited to 'src/zenserver/projectstore/httpprojectstore.cpp')
| -rw-r--r-- | src/zenserver/projectstore/httpprojectstore.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/zenserver/projectstore/httpprojectstore.cpp b/src/zenserver/projectstore/httpprojectstore.cpp index eb6407e1f..0b8e5f13b 100644 --- a/src/zenserver/projectstore/httpprojectstore.cpp +++ b/src/zenserver/projectstore/httpprojectstore.cpp @@ -1061,12 +1061,8 @@ HttpProjectService::HandleOplogOpNewRequest(HttpRouterRequest& Req) bool IsValid = true; std::vector<IoHash> MissingChunks; - std::vector<IoHash> ReferencedChunks; CbPackage::AttachmentResolver Resolver = [&](const IoHash& Hash) -> SharedBuffer { - // We want to add all chunks here so we can properly clear them from the 'prep' call where we retained them earlier - ReferencedChunks.push_back(Hash); - if (m_CidStore.ContainsChunk(Hash)) { // Return null attachment as we already have it, no point in reading it and storing it again @@ -1155,6 +1151,9 @@ HttpProjectService::HandleOplogOpNewRequest(HttpRouterRequest& Req) return HttpReq.WriteResponse(HttpResponseCode::BadRequest, HttpContentType::kText, "No oplog entry key specified"); } + std::vector<IoHash> ReferencedChunks; + Core.IterateAttachments([&ReferencedChunks](CbFieldView View) { ReferencedChunks.push_back(View.AsAttachment()); }); + // Write core to oplog size_t AttachmentCount = Package.GetAttachments().size(); @@ -1168,7 +1167,10 @@ HttpProjectService::HandleOplogOpNewRequest(HttpRouterRequest& Req) m_ProjectStats.ChunkWriteCount += AttachmentCount; // Once we stored the op, we no longer need to retain any chunks this op references - FoundLog->RemovePendingChunkReferences(ReferencedChunks); + if (!ReferencedChunks.empty()) + { + FoundLog->RemovePendingChunkReferences(ReferencedChunks); + } m_ProjectStats.OpWriteCount++; ZEN_DEBUG("'{}/{}' op #{} ({}) - '{}'", ProjectId, OplogId, OpLsn, NiceBytes(Payload.Size()), Core["key"sv].AsString()); |