From ab8a7f7a96201f4ec087957ff9db0968f44a78d4 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Sat, 28 Mar 2026 15:04:44 +0400 Subject: [PATCH] fix: client exits after --send-tone completes (was hanging on recv task) Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/wzp-client/src/cli.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/wzp-client/src/cli.rs b/crates/wzp-client/src/cli.rs index d26c30a..f838d0b 100644 --- a/crates/wzp-client/src/cli.rs +++ b/crates/wzp-client/src/cli.rs @@ -509,12 +509,13 @@ async fn run_file_mode( let all_pcm = if record_file.is_some() { // Wait a bit for remaining packets after sender finishes tokio::time::sleep(tokio::time::Duration::from_secs(2)).await; - // The recv task will be aborted when we drop it, but first - // let's signal it by closing transport transport.close().await?; recv_handle.await.unwrap_or_default() } else { - recv_handle.await.unwrap_or_default() + // No recording — just close and exit + transport.close().await?; + recv_handle.abort(); + Vec::new() }; // Write recorded audio to file