Compare commits

..

No commits in common. "24dbc2f432e7bafc17d2553b99f7f92e230d9db1" and "d5b0ea06cc4c9f5a16c7f89680b9d5ee4d1a50ad" have entirely different histories.

View File

@ -363,7 +363,11 @@ void CClient::handle_frame(CFrameBuffer* buf)
} }
case TYPE_TRANS_DONE: { case TYPE_TRANS_DONE: {
logger_->warn("Trans done, close file {}.", down_->cur_file_); logger_->warn("Trans done, close file {}.", down_->cur_file_);
report_trans_ret(TRANS_DONE); if (down_->file_) {
fclose(down_->file_);
down_->file_ = nullptr;
}
down_->trans_state_ = TRANS_DONE;
break; break;
} }
case TYPE_OFFLINE: { case TYPE_OFFLINE: {
@ -377,7 +381,7 @@ void CClient::handle_frame(CFrameBuffer* buf)
t->trans_state_ = TRANS_BREAK; t->trans_state_ = TRANS_BREAK;
break; break;
} }
if (downloading_ && !down_->cur_remote_file_.empty()) { if (!down_->cur_remote_file_.empty()) {
logger_->warn("Stop Down {} From {}.", down_->cur_remote_file_, buf->fid_); logger_->warn("Stop Down {} From {}.", down_->cur_remote_file_, buf->fid_);
} }
report_trans_ret(TRANS_FAILED); report_trans_ret(TRANS_FAILED);