diff options
| author | Dan Engelbrecht <[email protected]> | 2024-03-27 10:51:42 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-03-27 10:51:42 +0100 |
| commit | f52e01b95719a85580daceae90c74ab4dcd0d7d3 (patch) | |
| tree | 3a077b0170bf9ad29c796c7895760e3bdc105a0a | |
| parent | 5.4.2 (diff) | |
| download | zen-f52e01b95719a85580daceae90c74ab4dcd0d7d3.tar.xz zen-f52e01b95719a85580daceae90c74ab4dcd0d7d3.zip | |
Get raw size for compressed chunks correctly for `/prj/{project}/oplog/{log}/chunkinfos` (#27)
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 52e3d4975..d75be9b6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## +- Bugfix: Get raw size for compressed chunks correctly for `/prj/{project}/oplog/{log}/chunkinfos` + +## 5.4.2 - Bugfix: Shared memory for zenserver state may hang around after all zenserver processes exit - make sure we find a valid entry in `zen up` before bailing - Bugfix: Httpasio only call listen() once - Bugfix: Make sure exception do not leak out of async (worker thread pool) work and make sure we always wait for completion of all work diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index 7af543dbc..3d8004be3 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -2574,7 +2574,13 @@ ProjectStore::GetProjectChunkInfos(const std::string_view ProjectId, const std:: Response.BeginObject(); Response << "id"sv << ChunkInfo.first; Response << "rawhash"sv << ChunkInfo.second; - Response << "rawsize"sv << Chunk.GetSize(); + uint64_t RawSize = Chunk.GetSize(); + if (Chunk.GetContentType() == ZenContentType::kCompressedBinary) + { + IoHash _; + (void)CompressedBuffer::FromCompressed(SharedBuffer(Chunk), _, RawSize); + } + Response << "rawsize"sv << RawSize; Response.EndObject(); } } |