Skip to content

Commit

Permalink
Add helpful error message for response lines >4KiB
Browse files Browse the repository at this point in the history
This is a temporary fix until upstream libmpdclient is fixed, or we can
write our own MPD client if needed.

This is a temporary fix for issue #89.
  • Loading branch information
joshkunz committed Feb 11, 2021
1 parent 6af4b58 commit 65dec11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mpd_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ void SongReaderImpl::FetchNext() {
<< "consider setting max_output_buffer_size to a higher value\n"
<< "(e.g. 32768) in your MPD config." << std::endl;
}
if (err == MPD_ERROR_MALFORMED) {
std::cerr
<< "libmpdclient received a malformed response from the server.\n"
<< "This may be because a song's metadata attribute (for example,\n"
<< "a comment) was longer than 4KiB.\n"
<< "See https://github.com/joshkunz/ashuffle/issues/89 for\n"
<< "details or updates." << std::endl;
}
mpd_.CheckFail();
if (raw_song == nullptr) {
song_ = std::nullopt;
Expand Down

0 comments on commit 65dec11

Please sign in to comment.