From 1d54c2b8c5e7c782d952e0ee47413d71f0bc67a6 Mon Sep 17 00:00:00 2001 From: kimlwh Date: Fri, 3 Jan 2025 16:24:42 +0000 Subject: [PATCH] fix(rust/trezor-client) wait indefinitely when reading and shorter when writing data --- rust/trezor-client/src/transport/udp.rs | 4 ++-- rust/trezor-client/src/transport/webusb.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/trezor-client/src/transport/udp.rs b/rust/trezor-client/src/transport/udp.rs index 921a2c931d..ae2b073e00 100644 --- a/rust/trezor-client/src/transport/udp.rs +++ b/rust/trezor-client/src/transport/udp.rs @@ -19,8 +19,8 @@ use constants::{DEFAULT_DEBUG_PORT, DEFAULT_HOST, DEFAULT_PORT, LOCAL_LISTENER}; /// The chunk size for the serial protocol. const CHUNK_SIZE: usize = 64; -const READ_TIMEOUT_MS: u64 = 100000; -const WRITE_TIMEOUT_MS: u64 = 100000; +const READ_TIMEOUT_MS: u64 = 0; +const WRITE_TIMEOUT_MS: u64 = 1000; /// An available transport for connecting with a device. #[derive(Debug)] diff --git a/rust/trezor-client/src/transport/webusb.rs b/rust/trezor-client/src/transport/webusb.rs index 635f048ecb..1fe3739fbe 100644 --- a/rust/trezor-client/src/transport/webusb.rs +++ b/rust/trezor-client/src/transport/webusb.rs @@ -26,8 +26,8 @@ mod constants { /// The chunk size for the serial protocol. const CHUNK_SIZE: usize = 64; -const READ_TIMEOUT_MS: u64 = 100000; -const WRITE_TIMEOUT_MS: u64 = 100000; +const READ_TIMEOUT_MS: u64 = 0; +const WRITE_TIMEOUT_MS: u64 = 1000; /// An available transport for connecting with a device. #[derive(Debug)]