diff --git a/README.md b/README.md index dcbfca0..0bcf03b 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,8 @@ mark == 1 表示,服务客户端数据。 - 服务端如果最大上载速度下载速度(较慢)不一致,将导致大量数据堆积在`Server`端内存等待`Client`端缓慢处理。 -- 如果`client`端在传输数据的过程中异常关闭,`Server`端需要丢弃与该客户端相关的数据包。 \ No newline at end of file +- 如果`client`端在传输数据的过程中异常关闭,`Server`端需要丢弃与该客户端相关的数据包。 + +# 注意 + +- 如果两个`transmc`客户端在同一台机器上同时收发同一个文件将导致文件丢失损坏。 \ No newline at end of file diff --git a/client/client.cpp b/client/client.cpp index cc73231..83f8604 100644 --- a/client/client.cpp +++ b/client/client.cpp @@ -31,7 +31,7 @@ void CClient::run(const std::string& ip, const std::string& port) char line[512]{}; while (std::cin.getline(line, 512)) { std::string cmd_input(line); - if (std::strstr(line, "end")) { + if (cmd_input == "end") { break; } auto vec = COfStr::split(cmd_input, " "); diff --git a/client/file_oper.cpp b/client/file_oper.cpp index 518740a..34a86d8 100644 --- a/client/file_oper.cpp +++ b/client/file_oper.cpp @@ -19,7 +19,11 @@ std::vector CFileOpr::get_file_list(const std::string& input) } auto vec = COfStr::split(backup, "|"); for (const auto& item : vec) { - result.push_back(COfPath::to_full(item)); + std::string ret(item); + if (item.find("\"") != std::string::npos) { + ret = COfStr::replace(item, "\"", ""); + } + result.push_back(COfPath::to_full(ret)); } return result; }