diff options
| author | Dan Engelbrecht <[email protected]> | 2024-10-10 09:57:06 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-10-10 09:57:06 +0200 |
| commit | 14f2d5665e00f9742a417e913eb05af38e570ea5 (patch) | |
| tree | f6369d401a7b16edd894ac304f1c59f8b630cc48 | |
| parent | Dashboard: alignment of complex stats & logo goes home (#187) (diff) | |
| download | zen-14f2d5665e00f9742a417e913eb05af38e570ea5.tar.xz zen-14f2d5665e00f9742a417e913eb05af38e570ea5.zip | |
oplog mirror and vfs utf8 paths (#189)
* assume "filename" fields in oplog entries are utf8 paths
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | src/zen/cmds/projectstore_cmd.cpp | 6 | ||||
| -rw-r--r-- | src/zenserver/vfs/vfsimpl.cpp | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 13a27d015..1f61978be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ - Oplog entry view is more complete - Separate page for inspecting server stats - Improvement: When batch-fetching cache values/attachments, only use block memory-buffering for items that may be memcached to reduce disk I/O -- Cleanup: Removed GCv1 implementation, +- Bugfix: Parse filenames as utf8 string when mirroring files inside an oplog using `zen oplog-mirror` and `zen vfs` +- Cleanup: Removed GCv1 implementation ## 5.5.8 - Feature: Added option `gc-attachment-passes` to zenserver diff --git a/src/zen/cmds/projectstore_cmd.cpp b/src/zen/cmds/projectstore_cmd.cpp index 14cd2ce3d..48787be9b 100644 --- a/src/zen/cmds/projectstore_cmd.cpp +++ b/src/zen/cmds/projectstore_cmd.cpp @@ -1755,8 +1755,8 @@ OplogMirrorCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg { if (CbObjectView Data = DataIter.AsObjectView()) { - std::string FileName = std::string(Data["filename"sv].AsString()); - if (!m_FilenameFilter.empty() && FileName.find(m_FilenameFilter) == std::string::npos) + std::filesystem::path FileName(Data["filename"sv].AsU8String()); + if (!m_FilenameFilter.empty() && FileName.string().find(m_FilenameFilter) == std::string::npos) { continue; } @@ -1765,7 +1765,7 @@ OplogMirrorCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg { continue; } - if (!FileNames.insert(FileName).second) + if (!FileNames.insert(FileName.string()).second) { continue; } diff --git a/src/zenserver/vfs/vfsimpl.cpp b/src/zenserver/vfs/vfsimpl.cpp index abb7e8f94..7e4fbe83e 100644 --- a/src/zenserver/vfs/vfsimpl.cpp +++ b/src/zenserver/vfs/vfsimpl.cpp @@ -381,12 +381,12 @@ VfsServiceDataSource::PopulateDirectory(std::string NodePath, VfsTreeNode& DirNo { if (zen::CbObjectView Data = DataIter.AsObjectView()) { - std::string_view FileName = Data["filename"sv].AsString(); - zen::Oid ChunkId = Data["id"sv].AsObjectId(); + std::filesystem::path FileName(Data["filename"sv].AsU8String()); + zen::Oid ChunkId = Data["id"sv].AsObjectId(); if (auto FindIt = ChunkSizes.find(ChunkId); FindIt != ChunkSizes.end()) { - DirNode.AddFileNode(FileName, FindIt->second /* file size */, ChunkId, DataSource); + DirNode.AddFileNode(FileName.string(), FindIt->second /* file size */, ChunkId, DataSource); } else { |