diff --git a/crates/voelin-core/src/voice.rs b/crates/voelin-core/src/voice.rs index da0c9c5..729e20c 100644 --- a/crates/voelin-core/src/voice.rs +++ b/crates/voelin-core/src/voice.rs @@ -461,6 +461,11 @@ async fn run_inner( Input::Tick => voice.tick(), } }; + // The streams end now, not after the shutdown below (up to three seconds): + // the commands are not read any more, so a `StreamCmd::Shutdown` the + // session sends from here on would never reach the stream task. Its end + // needs nothing of the connection: it reports to the session's channels. + drop(voice.streams.take()); // Transfers the server never opened fail; running ones go on. for (_, job) in voice.jobs.drain() { job.report()(TransferState::Failed("disconnected".into()));