From 60ccf06a29e6a8c6b97a8237e5264aa1fec8893f Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Sun, 10 May 2026 12:30:43 +0000 Subject: [PATCH] fix: fall through to self-launch when peer forward fails --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f4381e0..8111108 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,8 +88,15 @@ fn main() { commands_path.push_str(&username()); let socket_path = Path::new(&commands_path); if let Ok(mut stream) = PipeClient::connect(socket_path) { - stream.write_all(command.as_bytes()).ok(); - exit(0); + let forwarded = stream + .write_all(command.as_bytes()) + .and_then(|_| stream.flush()) + .is_ok(); + drop(stream); + if forwarded { + exit(0); + } + eprintln!("Failed to forward command to existing Stremio instance; launching new instance"); } // END IPC