Skip to content

Adding non-existing song to queue hangs #62

@naglis

Description

@naglis

Using latest commit from main branch with following test:

#[test]
#[should_panic(expected = "Failed to access")]
fn add_non_existing_song_returns_error() {
    let mut mpd = connect();
    let _song_id = mpd.push(Song { file: "file:///hopefully/non/existing/song.mp3".to_string(), ..Default::default() }).unwrap();
}

results in the MPD connection hanging until MPD closes the client connection due to inactivity and the returned error is Parse(BadPair).

IIUC this is caused by the read_pair() implementation introduced in 8642c72. It parses the error ACK [52@0] {addid} Failed to access /hopefully/non/existing/song.mp3: No such file or directory returned by MPD as the song ID value and then read_field hangs when waiting for expect_ok(), since there is no OK line in case of an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions