mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-15 20:45:52 +00:00
fix: clipboard, cmd ipc (#9270)
1. Send raw contents if `content_len` > 1024*3. 2. Send raw contents if it is not empty. 3. Try read clipboard again if no data from cm. Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -498,10 +498,10 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
||||
let (content, next_raw) = {
|
||||
// TODO: find out a better threshold
|
||||
if content_len > 1024 * 3 {
|
||||
(c.content, false)
|
||||
} else {
|
||||
raw_contents.extend(c.content);
|
||||
(bytes::Bytes::new(), true)
|
||||
} else {
|
||||
(c.content, false)
|
||||
}
|
||||
};
|
||||
main_data.push(ClipboardNonFile {
|
||||
@@ -515,7 +515,9 @@ impl<T: InvokeUiCM> IpcTaskRunner<T> {
|
||||
});
|
||||
}
|
||||
allow_err!(self.stream.send(&Data::ClipboardNonFile(Some(("".to_owned(), main_data)))).await);
|
||||
allow_err!(self.stream.send_raw(raw_contents.into()).await);
|
||||
if !raw_contents.is_empty() {
|
||||
allow_err!(self.stream.send_raw(raw_contents.into()).await);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
allow_err!(self.stream.send(&Data::ClipboardNonFile(Some((format!("{}", e), vec![])))).await);
|
||||
|
||||
Reference in New Issue
Block a user