Merge pull request #874 from JasonLG1979/kill-the-undead

Prevent librespot from becoming a zombie
This commit is contained in:
Roderick van Domburg 2021-10-30 20:27:42 +02:00 committed by GitHub
commit 45b19efd03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- [cache] Add `disable-credential-cache` flag (breaking). - [cache] Add `disable-credential-cache` flag (breaking).
### Fixed
- [main] Prevent hang when discovery is disabled and there are no credentials or when bad credentials are given.
## [0.3.1] - 2021-10-24 ## [0.3.1] - 2021-10-24
### Changed ### Changed

View file

@ -647,6 +647,11 @@ fn get_setup(args: &[String]) -> Setup {
) )
}; };
if credentials.is_none() && matches.opt_present(DISABLE_DISCOVERY) {
error!("Credentials are required if discovery is disabled.");
exit(1);
}
let session_config = { let session_config = {
let device_id = device_id(&name); let device_id = device_id(&name);
@ -923,7 +928,8 @@ async fn main() {
player_event_channel = Some(event_channel); player_event_channel = Some(event_channel);
}, },
Err(e) => { Err(e) => {
warn!("Connection failed: {}", e); error!("Connection failed: {}", e);
exit(1);
} }
}, },
_ = async { spirc_task.as_mut().unwrap().await }, if spirc_task.is_some() => { _ = async { spirc_task.as_mut().unwrap().await }, if spirc_task.is_some() => {