From 32e09d00cb3a68fb30b6577f8c719dcf550b0033 Mon Sep 17 00:00:00 2001 From: taynpg Date: Fri, 20 Dec 2024 08:12:55 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=AD=A3=E4=BC=A0?= =?UTF-8?q?=E8=BE=93=E5=AE=8C=E6=88=90=E5=90=8E=EF=BC=8C=E5=AF=B9=E6=96=B9?= =?UTF-8?q?=E6=96=AD=E5=BC=80=E6=97=B6=E8=AF=AF=E6=89=93=E5=8D=B0=E4=B8=8D?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BF=A1=E6=81=AF=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/client.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/client.cpp b/client/client.cpp index 20cdf53..ec3fa39 100644 --- a/client/client.cpp +++ b/client/client.cpp @@ -363,11 +363,7 @@ void CClient::handle_frame(CFrameBuffer* buf) } case TYPE_TRANS_DONE: { logger_->warn("Trans done, close file {}.", down_->cur_file_); - if (down_->file_) { - fclose(down_->file_); - down_->file_ = nullptr; - } - down_->trans_state_ = TRANS_DONE; + report_trans_ret(TRANS_DONE); break; } case TYPE_OFFLINE: { @@ -381,7 +377,7 @@ void CClient::handle_frame(CFrameBuffer* buf) t->trans_state_ = TRANS_BREAK; break; } - if (!down_->cur_remote_file_.empty()) { + if (downloading_ && !down_->cur_remote_file_.empty()) { logger_->warn("Stop Down {} From {}.", down_->cur_remote_file_, buf->fid_); } report_trans_ret(TRANS_FAILED);