mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-03-15 15:36:44 +08:00
refactor: 清理死代码和优化日志级别
- 删除未使用的函数和常量 - create_public_key_message (rustdesk/connection) - decode_audio_packet, AudioPacketHeader (web/audio_ws) - io_error_to_hid_error, close_device, close_all_devices (hid) - shutdown_rx (rustdesk/mod) - CONNECT_TIMEOUT_MS, RESP_ERR_SEND_FAILED - 调整日志级别 - Session lagged: warn -> debug - 移除 H264 NAL trace 日志 - 移除 Frame distribution lagged trace 日志 - 移除 absolute mouse report trace 日志 - 优化 broadcast channel 缓冲区大小 8 -> 16 - 修复条件编译 - static_files.rs: 添加 debug_assertions 条件
This commit is contained in:
@@ -449,29 +449,6 @@ impl Ch9329Backend {
|
||||
self.port.lock().is_some()
|
||||
}
|
||||
|
||||
/// Convert I/O error to HidError with appropriate error code
|
||||
#[allow(dead_code)]
|
||||
fn io_error_to_hid_error(e: std::io::Error, operation: &str) -> AppError {
|
||||
let error_code = match e.kind() {
|
||||
std::io::ErrorKind::NotFound => "port_not_found",
|
||||
std::io::ErrorKind::PermissionDenied => "permission_denied",
|
||||
std::io::ErrorKind::TimedOut => "timeout",
|
||||
std::io::ErrorKind::BrokenPipe => "broken_pipe",
|
||||
_ => match e.raw_os_error() {
|
||||
Some(6) => "enxio", // ENXIO - no such device
|
||||
Some(19) => "enodev", // ENODEV - no such device
|
||||
Some(5) => "eio", // EIO - I/O error
|
||||
_ => "serial_error",
|
||||
},
|
||||
};
|
||||
|
||||
AppError::HidError {
|
||||
backend: "ch9329".to_string(),
|
||||
reason: format!("{}: {}", operation, e),
|
||||
error_code: error_code.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert serialport error to HidError
|
||||
fn serial_error_to_hid_error(e: serialport::Error, operation: &str) -> AppError {
|
||||
let error_code = match e.kind() {
|
||||
|
||||
Reference in New Issue
Block a user