From c7a0ddf9f26fdd647574e4031a66362234298e7a Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 30 Apr 2024 10:11:25 +0200 Subject: fix get project files loop (#68) - Bugfix: Remove extra loop causing GetProjectFiles for project store to find all chunks once for each chunk found - Bugfix: Don't capture ChunkIndex variable in CasImpl::IterateChunks by reference as it causes crash - Improvement: Make FileCasStrategy::IterateChunks (optionally) multithreaded (improves GetProjectFiles performance) --- src/zenutil/packageformat.cpp | 47 +++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'src/zenutil/packageformat.cpp') diff --git a/src/zenutil/packageformat.cpp b/src/zenutil/packageformat.cpp index 3fa602a96..2512351f5 100644 --- a/src/zenutil/packageformat.cpp +++ b/src/zenutil/packageformat.cpp @@ -461,19 +461,21 @@ ParsePackageMessage(IoBuffer Payload, std::functionPayloadByteOffset, - AttachRefHdr->PayloadByteSize))); + AttachRefHdr->PayloadByteSize, + Entry.AttachmentHash))); } } else { MalformedAttachments.push_back(std::make_pair(i, - fmt::format("Unable to resolve chunk at '{}' (offset {}, size {})", + fmt::format("Unable to resolve chunk at '{}' (offset {}, size {}) for {}", Path, AttachRefHdr->PayloadByteOffset, - AttachRefHdr->PayloadByteSize))); + AttachRefHdr->PayloadByteSize, + Entry.AttachmentHash))); } } else if (Entry.Flags & CbAttachmentEntry::kIsCompressed) @@ -490,17 +492,20 @@ ParsePackageMessage(IoBuffer Payload, std::function 0) { // Make a copy of the buffer so the attachments don't reference the entire payload IoBuffer AttachmentBufferCopy = CreateBuffer(Entry.AttachmentHash, AttachmentSize); @@ -544,6 +552,11 @@ ParsePackageMessage(IoBuffer Payload, std::function