From 3e1654802bedf0b2be75695a575f9468a94b3832 Mon Sep 17 00:00:00 2001 From: taynpg Date: Tue, 25 Feb 2025 16:15:12 +0800 Subject: [PATCH] =?UTF-8?q?remove=EF=BC=9A=E7=A7=BB=E9=99=A4=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E5=87=8F=E5=B0=91=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/client.cpp | 6 ++++++ server/server.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/client.cpp b/client/client.cpp index b702999..1b48f13 100644 --- a/client/client.cpp +++ b/client/client.cpp @@ -391,6 +391,12 @@ bool CClient::request_update_list(const std::string& param) // 读取list文件 std::string list_file_full = COfPath::to_full(list_file); + + if (fs::is_directory(list_file_full)) { + TLOGE(log_, "{} is a directory, only support file.", list_file_full); + return false; + } + std::ifstream in(list_file_full); if (!in.is_open()) { TLOGE(log_, "Can't Open File:{}", list_file_full); diff --git a/server/server.cpp b/server/server.cpp index 1f23f4d..e56b2fb 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -97,7 +97,7 @@ void CTcpServer::get_client_list(CFrameBuffer** buf) std::string msg; int index = 1; for (const auto& item : vec) { - msg.append(fmt::format("[{}][{}][{}][{}]", index, item.id_, item.online_time_, item.task_time_)); + msg.append(fmt::format("[{}][{}][{}]", index, item.id_, item.online_time_)); auto files = COfStr::split(item.task_, "|"); for (const auto& file : files) { msg.append("\n" + file);