diff options
| author | Stefan Boberg <[email protected]> | 2021-11-01 18:35:05 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-01 18:35:05 +0100 |
| commit | d13fbfa5a9e582fac03766219b0ba1019525caae (patch) | |
| tree | 9ea2e3f78f83547c9a79864fede20d524dca18a6 | |
| parent | Merge branch 'gc' of https://github.com/EpicGames/zen into gc (diff) | |
| download | zen-d13fbfa5a9e582fac03766219b0ba1019525caae.tar.xz zen-d13fbfa5a9e582fac03766219b0ba1019525caae.zip | |
caslog: Added GetLogSize, fixed issue with append offset computation
| -rw-r--r-- | zenstore/caslog.cpp | 8 | ||||
| -rw-r--r-- | zenstore/include/zenstore/caslog.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/zenstore/caslog.cpp b/zenstore/caslog.cpp index 38d0f818e..369bc55ad 100644 --- a/zenstore/caslog.cpp +++ b/zenstore/caslog.cpp @@ -102,6 +102,12 @@ CasLogFile::Close() m_File.Close(); } +uint64_t +CasLogFile::GetLogSize() +{ + return m_File.FileSize(); +} + void CasLogFile::Replay(std::function<void(const void*)>&& Handler) { @@ -132,7 +138,7 @@ CasLogFile::Replay(std::function<void(const void*)>&& Handler) Handler(ReadBuffer.data() + (i * m_RecordSize)); } - m_AppendOffset = LogBaseOffset + (LogFileSize * LogEntryCount); + m_AppendOffset = LogBaseOffset + (m_RecordSize * LogEntryCount); } void diff --git a/zenstore/include/zenstore/caslog.h b/zenstore/include/zenstore/caslog.h index 065a74b25..bb9d07726 100644 --- a/zenstore/include/zenstore/caslog.h +++ b/zenstore/include/zenstore/caslog.h @@ -27,6 +27,7 @@ public: void Replay(std::function<void(const void*)>&& Handler); void Flush(); void Close(); + uint64_t GetLogSize(); private: struct FileHeader |