From 33e2b663b85bfa134f904cbc42e4b9351d11b086 Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Thu, 7 May 2026 21:04:44 +0700 Subject: [PATCH] fix(client): report read-timeout restore failures --- crates/irtt-client/src/client.rs | 2 +- crates/irtt-client/src/error.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/irtt-client/src/client.rs b/crates/irtt-client/src/client.rs index 356721f..4decdf6 100644 --- a/crates/irtt-client/src/client.rs +++ b/crates/irtt-client/src/client.rs @@ -85,7 +85,7 @@ impl Client { .set_read_timeout(self.config.socket_config.recv_timeout); match (outcome, restore) { (Ok(outcome), Ok(())) => Ok(outcome), - (Ok(outcome), Err(_)) => Ok(outcome), + (Ok(_), Err(source)) => Err(ClientError::ReadTimeoutRestore { source }), (Err(err), Ok(())) => Err(err), (Err(err), Err(_)) => Err(err), } diff --git a/crates/irtt-client/src/error.rs b/crates/irtt-client/src/error.rs index e446a7b..9c5179e 100644 --- a/crates/irtt-client/src/error.rs +++ b/crates/irtt-client/src/error.rs @@ -14,6 +14,8 @@ pub enum ClientError { remote: std::net::SocketAddr, source: io::Error, }, + #[error("failed to restore configured socket read timeout after open negotiation: {source}")] + ReadTimeoutRestore { source: io::Error }, #[error("protocol error: {0}")] Protocol(#[from] irtt_proto::ProtoError), #[error("all open requests timed out")]