From 017cb1d5702a32603810545cd74c1da65e35d12d Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Wed, 8 Jan 2025 08:07:38 +0100 Subject: MPD client: tolerate usage while disconnected If the client is password-protected, this will not automagically make queued up commands work, but it's better than hitting the poller assertion. --- liberty-proto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/liberty-proto.c b/liberty-proto.c index d4355c7..fb0fc36 100644 --- a/liberty-proto.c +++ b/liberty-proto.c @@ -1594,6 +1594,8 @@ mpd_client_parse_kv (char *line, char **value) static void mpd_client_update_poller (struct mpd_client *self) { + if (self->state != MPD_CONNECTED) + return; poller_fd_set (&self->socket_event, self->write_buffer.len ? (POLLIN | POLLOUT) : POLLIN); } -- cgit v1.2.3-70-g09d2