From d5247853764541c191b2ad8a700136ecbc6c052d Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Thu, 16 Oct 2025 14:29:39 +0200 Subject: [PATCH] Fix windows --- .../ssh_agent/src/transport/named_pipe_listener_stream.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/desktop/desktop_native/ssh_agent/src/transport/named_pipe_listener_stream.rs b/apps/desktop/desktop_native/ssh_agent/src/transport/named_pipe_listener_stream.rs index 7861fdc49a9..b3e67bf621d 100644 --- a/apps/desktop/desktop_native/ssh_agent/src/transport/named_pipe_listener_stream.rs +++ b/apps/desktop/desktop_native/ssh_agent/src/transport/named_pipe_listener_stream.rs @@ -24,10 +24,11 @@ impl NamedPipeServerStream { pub async fn listen( pipe_name: String, agent: BitwardenDesktopAgent, - ) -> Result { + ) -> Result<(), anyhow::Error> { info!("Starting SSH Named Pipe listener"); let (tx, rx) = tokio::sync::mpsc::channel(16); + let cloned_agent = agent.clone(); tokio::spawn(async move { info!("Creating named pipe server on {}", pipe_name.clone()); let mut listener = match ServerOptions::new().create(pipe_name.clone()) { @@ -37,7 +38,7 @@ impl NamedPipeServerStream { return; } }; - let cancellation_token = agent.cancellation_token(); + let cancellation_token = cloned_agent.cancellation_token(); loop { info!("Waiting for connection"); select! { @@ -72,7 +73,8 @@ impl NamedPipeServerStream { } }); - Ok(NamedPipeServerStream { rx }) + agent.serve(NamedPipeServerStream { rx }).await; + Ok(()) } }