aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/vfs/vfsimpl.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-09-30 22:03:31 +0200
committerGitHub Enterprise <[email protected]>2025-09-30 22:03:31 +0200
commit04ce16176630799ebf7035d70348d4b7c9a31bb4 (patch)
treed1332fc2faa87a81462ca573bbb041e1562851ab /src/zenserver/vfs/vfsimpl.cpp
parentfix bounds check when finalizing build state (#533) (diff)
downloadzen-04ce16176630799ebf7035d70348d4b7c9a31bb4.tar.xz
zen-04ce16176630799ebf7035d70348d4b7c9a31bb4.zip
projectstore refactor (#531)
* convert ProjectStore::GetProjectFiles to not use http return codes * convert ProjectStore::GetProjectChunkInfos to not use http return codes * convert ProjectStore::GetChunkInfo to not use http return codes * convert ProjectStore::GetChunkRange to not use http return codes * convert ProjectStore::GetChunk to not use http return codes * convert ProjectStore::PutChunk to not use http return codes * convert ProjectStore::WriteOplog to not use http return codes * convert ProjectStore::ReadOplog to not use http return codes
Diffstat (limited to 'src/zenserver/vfs/vfsimpl.cpp')
-rw-r--r--src/zenserver/vfs/vfsimpl.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/zenserver/vfs/vfsimpl.cpp b/src/zenserver/vfs/vfsimpl.cpp
index d44222e00..e698d6d19 100644
--- a/src/zenserver/vfs/vfsimpl.cpp
+++ b/src/zenserver/vfs/vfsimpl.cpp
@@ -38,24 +38,13 @@ VfsOplogDataSource::ReadNamedData(std::string_view Path, void* Buffer, uint64_t
void
VfsOplogDataSource::ReadChunkData(const Oid& ChunkId, void* Buffer, uint64_t ByteOffset, uint64_t ByteCount)
{
- CompositeBuffer ChunkBuffer;
- ZenContentType ContentType;
- auto Result = m_ProjectStore->GetChunkRange(m_ProjectId,
- m_OplogId,
- ChunkId,
- 0,
- ~0ull,
- ZenContentType::kCompressedBinary,
- /* out */ ChunkBuffer,
- /* out */ ContentType,
- /* OptionalInOutModificationTag */ nullptr);
-
- if (Result.first == HttpResponseCode::OK)
+ IoBuffer ChunkBuffer = m_ProjectStore->GetChunk(m_ProjectId, m_OplogId, ChunkId);
+ if (ChunkBuffer)
{
ZEN_ASSERT(ChunkBuffer.GetSize() >= ByteOffset);
ZEN_ASSERT(ChunkBuffer.GetSize() - ByteOffset >= ByteCount);
MutableMemoryView Target(Buffer, ByteCount);
- ChunkBuffer.CopyTo(Target, ByteOffset);
+ Target.CopyFrom(ChunkBuffer.GetView().Mid(ByteOffset, ByteCount));
}
}