fix:修正Linux编译。

This commit is contained in:
taynpg 2024-12-17 09:40:18 +08:00
parent 834b77d74e
commit 208cd56ee3

View File

@ -133,11 +133,15 @@ bool CClient::cancel_task()
bool CClient::down_one_file(const std::string& id, const std::string& file)
{
down_->cur_remote_id_ = id;
#ifdef _WIN32
down_->cur_remote_file_ = CCodec::u8ToGBK(file);
#else
down_->cur_remote_file_ = file;
#endif
fs::path remote_file(ofen::COfPath::normalize(down_->cur_remote_file_));
down_->cur_file_ = COfPath::to_full(remote_file.filename().string());
logger_->warn("Start Down => {} To {}", file, down_->cur_file_);
logger_->warn("Start Down => {} To {}", down_->cur_remote_file_, down_->cur_file_);
// 请求下载文件
std::shared_ptr<CFrameBuffer> buf = std::make_shared<CFrameBuffer>();
@ -221,7 +225,11 @@ void CClient::handle_frame(CFrameBuffer* buf)
continue;
}
if (real.find("[") == std::string::npos) {
#ifdef _WIN32
logger_->info("FILE ==> {}", CCodec::u8ToGBK(real));
#else
logger_->info("FILE ==> {}", real);
#endif
task_list_[index]->files.push_back(real);
} else {
auto a = real.find_first_of("[") + 1;