mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-03-30 13:35:31 +08:00
Compare commits
2 Commits
5f320af6e6
...
v1.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78c82f778a | ||
|
|
ab89a3d41a |
@@ -1283,10 +1283,20 @@ void Render::InitializeModules() {
|
|||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
LOG_WARN("Failed to send clipboard data to peer [{}], ret={}",
|
LOG_WARN("Failed to send clipboard data to peer [{}], ret={}",
|
||||||
remote_id.c_str(), ret);
|
remote_id.c_str(), ret);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
|
ret = SendReliableDataFrame(peer_, data, size,
|
||||||
|
clipboard_label_.c_str());
|
||||||
|
if (ret != 0) {
|
||||||
|
LOG_WARN("Failed to send clipboard data to peer [{}], ret={}",
|
||||||
|
remote_id_display_, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
modules_inited_ = true;
|
modules_inited_ = true;
|
||||||
|
|||||||
@@ -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