diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ba932b..69bc411 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,9 +20,9 @@ } ], "visualizerFile": "${workspaceRoot}/.vscode/qt5.natvis", - // "args": [ - // "-n", "1" - // ] + "args": [ + "-u", "0" + ] }, "cmake.environment": { "PATH": "${env:PATH};" diff --git a/CMakeLists.txt b/CMakeLists.txt index ac76166..e5454a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(transm VERSION 1.3.1 LANGUAGES CXX) +project(transm VERSION 1.3.2 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/client/client.cpp b/client/client.cpp index dd8d01c..55940f8 100644 --- a/client/client.cpp +++ b/client/client.cpp @@ -472,9 +472,10 @@ bool CClient::request_update_list(const std::string& param) } const auto& sr = task_list_[index]; + bool local_trans = false; if (sr->id == own_id_) { - TLOGW("You can't update your own file!!!"); - return false; + TLOGW("local_trans path handle mode!!!"); + local_trans = true; } // 读取list文件 @@ -513,13 +514,29 @@ bool CClient::request_update_list(const std::string& param) auto v = COfStr::split(hitem, "|"); if (v.size() >= 2) { auto pr = variable_handle(list_file_full, v[0], true); + pr = COfPath::standardize(pr); if (!fs::exists(pr)) { TLOGE("file {} not exist.", pr); valid = false; break; } TLOGI("--->check pass {}:{}", line, pr); - mre[line++] = pr + "|" + v[1]; + auto sec = v[1]; + if (local_trans) { + sec = variable_handle(list_file_full, v[1], true); + sec = COfPath::standardize(sec); + if (!fs::is_directory(sec) || !fs::exists(sec)) { + TLOGE("not directory or {} not exist.", pr); + valid = false; + break; + } + if (COfPath::is_same_dir(pr, sec)) { + TLOGE("Local Trans Can't Transfer {} to {}", pr, sec); + valid = false; + break; + } + } + mre[line++] = pr + "|" + sec; continue; } valid = false; @@ -527,7 +544,7 @@ bool CClient::request_update_list(const std::string& param) } if (!valid) { - TLOGE("Judge List File {} Format Not Passed.", list_file_full); + TLOGE("Judge List File {} Format Or Logic Not Passed.", list_file_full); return false; } diff --git a/ofen b/ofen index c9ab756..a667080 160000 --- a/ofen +++ b/ofen @@ -1 +1 @@ -Subproject commit c9ab756852084c1d6f8e5fb90c2e8d6c441a08d3 +Subproject commit a667080d96395792cd3c6066ef0ebe6c8b508bbe