mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-03-22 15:59:07 +08:00
[chore] remove SetOnFileComplete() in class FileReceiver
This commit is contained in:
@@ -298,10 +298,6 @@ bool FileReceiver::HandleChunk(const FileChunkHeader& header,
|
|||||||
LOG_INFO("FileReceiver: file received complete, file_id={}, size={}",
|
LOG_INFO("FileReceiver: file received complete, file_id={}, size={}",
|
||||||
header.file_id, ctx.received);
|
header.file_id, ctx.received);
|
||||||
|
|
||||||
if (on_file_complete_) {
|
|
||||||
on_file_complete_(saved_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
contexts_.erase(header.file_id);
|
contexts_.erase(header.file_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,8 +93,6 @@ class FileReceiver {
|
|||||||
// return true if parsed and processed successfully, false otherwise.
|
// return true if parsed and processed successfully, false otherwise.
|
||||||
bool OnData(const char* data, size_t size);
|
bool OnData(const char* data, size_t size);
|
||||||
|
|
||||||
void SetOnFileComplete(OnFileComplete cb) { on_file_complete_ = cb; }
|
|
||||||
|
|
||||||
void SetOnSendAck(OnSendAck cb) { on_send_ack_ = cb; }
|
void SetOnSendAck(OnSendAck cb) { on_send_ack_ = cb; }
|
||||||
|
|
||||||
const std::filesystem::path& OutputDir() const { return output_dir_; }
|
const std::filesystem::path& OutputDir() const { return output_dir_; }
|
||||||
@@ -108,7 +106,6 @@ class FileReceiver {
|
|||||||
private:
|
private:
|
||||||
std::filesystem::path output_dir_;
|
std::filesystem::path output_dir_;
|
||||||
std::unordered_map<uint32_t, FileContext> contexts_;
|
std::unordered_map<uint32_t, FileContext> contexts_;
|
||||||
OnFileComplete on_file_complete_ = nullptr;
|
|
||||||
OnSendAck on_send_ack_ = nullptr;
|
OnSendAck on_send_ack_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user