add debug log

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-07-30 17:16:25 +08:00
parent ac743ca2fe
commit 549dc05713

View File

@ -535,8 +535,6 @@ extern "C" fn client_format_list(
_context: *mut CliprdrClientContext, _context: *mut CliprdrClientContext,
clip_format_list: *const CLIPRDR_FORMAT_LIST, clip_format_list: *const CLIPRDR_FORMAT_LIST,
) -> UINT { ) -> UINT {
log::debug!("client_format_list called");
let conn_id; let conn_id;
let mut format_list: Vec<(i32, String)> = Vec::new(); let mut format_list: Vec<(i32, String)> = Vec::new();
unsafe { unsafe {
@ -561,6 +559,8 @@ extern "C" fn client_format_list(
} }
conn_id = (*clip_format_list).connID as i32; conn_id = (*clip_format_list).connID as i32;
} }
log::debug!("client_format_list called, client id: {}, format_list: {:?}", conn_id, &format_list);
let data = ClipboardFile::FormatList { format_list }; let data = ClipboardFile::FormatList { format_list };
// no need to handle result here // no need to handle result here
if conn_id == 0 { if conn_id == 0 {
@ -580,14 +580,13 @@ extern "C" fn client_format_list_response(
_context: *mut CliprdrClientContext, _context: *mut CliprdrClientContext,
format_list_response: *const CLIPRDR_FORMAT_LIST_RESPONSE, format_list_response: *const CLIPRDR_FORMAT_LIST_RESPONSE,
) -> UINT { ) -> UINT {
log::debug!("client_format_list_response called");
let conn_id; let conn_id;
let msg_flags; let msg_flags;
unsafe { unsafe {
conn_id = (*format_list_response).connID as i32; conn_id = (*format_list_response).connID as i32;
msg_flags = (*format_list_response).msgFlags as i32; msg_flags = (*format_list_response).msgFlags as i32;
} }
log::debug!("client_format_list_response called, client id: {}, msg_flags: {}", conn_id, msg_flags);
let data = ClipboardFile::FormatListResponse { msg_flags }; let data = ClipboardFile::FormatListResponse { msg_flags };
send_data(conn_id, data); send_data(conn_id, data);
@ -618,8 +617,6 @@ extern "C" fn client_format_data_response(
_context: *mut CliprdrClientContext, _context: *mut CliprdrClientContext,
format_data_response: *const CLIPRDR_FORMAT_DATA_RESPONSE, format_data_response: *const CLIPRDR_FORMAT_DATA_RESPONSE,
) -> UINT { ) -> UINT {
log::debug!("cconn_idlient_format_data_response called");
let conn_id; let conn_id;
let msg_flags; let msg_flags;
let format_data; let format_data;
@ -636,6 +633,7 @@ extern "C" fn client_format_data_response(
.to_vec(); .to_vec();
} }
} }
log::debug!("client_format_data_response called, client id: {}, msg_flags: {}", conn_id, msg_flags);
let data = ClipboardFile::FormatDataResponse { let data = ClipboardFile::FormatDataResponse {
msg_flags, msg_flags,
format_data, format_data,
@ -649,8 +647,6 @@ extern "C" fn client_file_contents_request(
_context: *mut CliprdrClientContext, _context: *mut CliprdrClientContext,
file_contents_request: *const CLIPRDR_FILE_CONTENTS_REQUEST, file_contents_request: *const CLIPRDR_FILE_CONTENTS_REQUEST,
) -> UINT { ) -> UINT {
log::debug!("client_file_contents_request called");
// TODO: support huge file? // TODO: support huge file?
// if (!cliprdr->hasHugeFileSupport) // if (!cliprdr->hasHugeFileSupport)
// { // {
@ -692,6 +688,8 @@ extern "C" fn client_file_contents_request(
have_clip_data_id, have_clip_data_id,
clip_data_id, clip_data_id,
}; };
log::debug!("client_file_contents_request called, data: {:?}", &data);
send_data(conn_id, data); send_data(conn_id, data);
0 0
@ -701,8 +699,6 @@ extern "C" fn client_file_contents_response(
_context: *mut CliprdrClientContext, _context: *mut CliprdrClientContext,
file_contents_response: *const CLIPRDR_FILE_CONTENTS_RESPONSE, file_contents_response: *const CLIPRDR_FILE_CONTENTS_RESPONSE,
) -> UINT { ) -> UINT {
log::debug!("client_file_contents_response called");
let conn_id; let conn_id;
let msg_flags; let msg_flags;
let stream_id; let stream_id;
@ -726,6 +722,7 @@ extern "C" fn client_file_contents_response(
stream_id, stream_id,
requested_data, requested_data,
}; };
log::debug!("client_file_contents_response called, conn_id: {}, msg_flags: {}, stream_id: {}", conn_id, msg_flags, stream_id);
send_data(conn_id, data); send_data(conn_id, data);
0 0