mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 02:09:26 +02:00
Prevent librespot from becoming a zombie
Prevent hang when discovery is disabled and there are no credentials or when bad credentials are given.
This commit is contained in:
parent
5049cd76e0
commit
24e4d2b636
2 changed files with 10 additions and 1 deletions
|
@ -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 device_id = device_id(&name);
|
||||
|
||||
|
@ -923,7 +928,8 @@ async fn main() {
|
|||
player_event_channel = Some(event_channel);
|
||||
},
|
||||
Err(e) => {
|
||||
warn!("Connection failed: {}", e);
|
||||
error!("Connection failed: {}", e);
|
||||
exit(1);
|
||||
}
|
||||
},
|
||||
_ = async { spirc_task.as_mut().unwrap().await }, if spirc_task.is_some() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue