From 21175d735b5459d244c47be1b7fc8fabf874624a Mon Sep 17 00:00:00 2001 From: NH Date: Sun, 19 Oct 2025 14:38:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/net/http_response.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/net/http_response.cpp b/src/net/http_response.cpp index 86a6c28..781b9dd 100644 --- a/src/net/http_response.cpp +++ b/src/net/http_response.cpp @@ -154,25 +154,25 @@ bool ylib::network::http::response::send_file(const std::string& filepath, int32 //ylib::log->info(filepath2,"response"); //取文件信息 - /*{ + { struct _stat64 statbuf; if (_stat64(filepath2.c_str(), &statbuf) != 0) return false; filesize = statbuf.st_size; last_modify_time = statbuf.st_mtime; - }*/ - { - auto filesize = std::filesystem::file_size(filepath2); - auto ftime = std::filesystem::last_write_time(filepath2); - // 把 file_time_type 转为 system_clock::time_point - auto sctp = std::chrono::time_point_cast( - ftime - decltype(ftime)::clock::now() + std::chrono::system_clock::now() - ); - - // 转为 time_t(UNIX 时间戳) - last_modify_time = std::chrono::system_clock::to_time_t(sctp); } + //{ + // auto filesize = std::filesystem::file_size(filepath2); + // auto ftime = std::filesystem::last_write_time(filepath2); + // // 把 file_time_type 转为 system_clock::time_point + // auto sctp = std::chrono::time_point_cast( + // ftime - decltype(ftime)::clock::now() + std::chrono::system_clock::now() + // ); + + // // 转为 time_t(UNIX 时间戳) + // last_modify_time = std::chrono::system_clock::to_time_t(sctp); + //} // 设置为已发送 m_response = true; //if (filesize != 0)