mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
init sync file clipboard, local to remote
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
@@ -70,6 +70,7 @@ struct MsgChannel {
|
||||
lazy_static::lazy_static! {
|
||||
static ref VEC_MSG_CHANNEL: RwLock<Vec<MsgChannel>> = Default::default();
|
||||
static ref CLIENT_CONN_ID_COUNTER: Mutex<i32> = Mutex::new(0);
|
||||
static ref LAST_FILE_FORMAT_LIST: Arc<Mutex<Option<ClipboardFile>>> = Default::default();
|
||||
}
|
||||
|
||||
impl ClipboardFile {
|
||||
@@ -90,6 +91,11 @@ impl ClipboardFile {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_last_file_format_list() -> Option<ClipboardFile> {
|
||||
LAST_FILE_FORMAT_LIST.lock().unwrap().clone()
|
||||
}
|
||||
|
||||
pub fn get_client_conn_id(session_uuid: &SessionID) -> Option<i32> {
|
||||
VEC_MSG_CHANNEL
|
||||
.read()
|
||||
@@ -561,6 +567,7 @@ extern "C" fn client_format_list(
|
||||
}
|
||||
log::debug!("client_format_list called, client id: {}, format_list: {:?}", conn_id, &format_list);
|
||||
let data = ClipboardFile::FormatList { format_list };
|
||||
*LAST_FILE_FORMAT_LIST.lock().unwrap() = Some(data.clone());
|
||||
// no need to handle result here
|
||||
if conn_id == 0 {
|
||||
// msg_channel is used for debug, VEC_MSG_CHANNEL cannot be inspected by the debugger.
|
||||
|
||||
Reference in New Issue
Block a user