mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-30 08:31:08 +03:00
fix: win, file clipboard (#9243)
1. Return the result of `wait_response_event()` in `cliprdr_send_format_list()` 2. Add recv flags to avoid waiting a long time. Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
use crate::{
|
||||
allow_err, send_data, ClipboardFile, CliprdrError, CliprdrServiceContext, ResultType,
|
||||
ERR_CODE_INVALID_PARAMETER, ERR_CODE_SERVER_FUNCTION_NONE, VEC_MSG_CHANNEL,
|
||||
ERR_CODE_INVALID_PARAMETER, ERR_CODE_SEND_MSG, ERR_CODE_SERVER_FUNCTION_NONE, VEC_MSG_CHANNEL,
|
||||
};
|
||||
use hbb_common::log;
|
||||
use std::{
|
||||
@@ -998,7 +998,7 @@ extern "C" fn notify_callback(conn_id: UINT32, msg: *const NOTIFICATION_MESSAGE)
|
||||
}
|
||||
};
|
||||
// no need to handle result here
|
||||
send_data(conn_id as _, data);
|
||||
allow_err!(send_data(conn_id as _, data));
|
||||
|
||||
0
|
||||
}
|
||||
@@ -1045,7 +1045,13 @@ extern "C" fn client_format_list(
|
||||
.iter()
|
||||
.for_each(|msg_channel| allow_err!(msg_channel.sender.send(data.clone())));
|
||||
} else {
|
||||
send_data(conn_id, data);
|
||||
match send_data(conn_id, data) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
log::error!("failed to send format list: {:?}", e);
|
||||
return ERR_CODE_SEND_MSG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
0
|
||||
@@ -1067,9 +1073,13 @@ extern "C" fn client_format_list_response(
|
||||
msg_flags
|
||||
);
|
||||
let data = ClipboardFile::FormatListResponse { msg_flags };
|
||||
send_data(conn_id, data);
|
||||
|
||||
0
|
||||
match send_data(conn_id, data) {
|
||||
Ok(_) => 0,
|
||||
Err(e) => {
|
||||
log::error!("failed to send format list response: {:?}", e);
|
||||
ERR_CODE_SEND_MSG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn client_format_data_request(
|
||||
@@ -1090,10 +1100,13 @@ extern "C" fn client_format_data_request(
|
||||
conn_id,
|
||||
requested_format_id
|
||||
);
|
||||
// no need to handle result here
|
||||
send_data(conn_id, data);
|
||||
|
||||
0
|
||||
match send_data(conn_id, data) {
|
||||
Ok(_) => 0,
|
||||
Err(e) => {
|
||||
log::error!("failed to send format data request: {:?}", e);
|
||||
ERR_CODE_SEND_MSG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn client_format_data_response(
|
||||
@@ -1125,9 +1138,13 @@ extern "C" fn client_format_data_response(
|
||||
msg_flags,
|
||||
format_data,
|
||||
};
|
||||
send_data(conn_id, data);
|
||||
|
||||
0
|
||||
match send_data(conn_id, data) {
|
||||
Ok(_) => 0,
|
||||
Err(e) => {
|
||||
log::error!("failed to send format data response: {:?}", e);
|
||||
ERR_CODE_SEND_MSG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn client_file_contents_request(
|
||||
@@ -1175,9 +1192,13 @@ extern "C" fn client_file_contents_request(
|
||||
clip_data_id,
|
||||
};
|
||||
log::debug!("client_file_contents_request called, data: {:?}", &data);
|
||||
send_data(conn_id, data);
|
||||
|
||||
0
|
||||
match send_data(conn_id, data) {
|
||||
Ok(_) => 0,
|
||||
Err(e) => {
|
||||
log::error!("failed to send file contents request: {:?}", e);
|
||||
ERR_CODE_SEND_MSG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn client_file_contents_response(
|
||||
@@ -1213,7 +1234,11 @@ extern "C" fn client_file_contents_response(
|
||||
msg_flags,
|
||||
stream_id
|
||||
);
|
||||
send_data(conn_id, data);
|
||||
|
||||
0
|
||||
match send_data(conn_id, data) {
|
||||
Ok(_) => 0,
|
||||
Err(e) => {
|
||||
log::error!("failed to send file contents response: {:?}", e);
|
||||
ERR_CODE_SEND_MSG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user