aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2025-01-08 08:07:38 +0100
committerPřemysl Eric Janouch <p@janouch.name>2025-01-08 08:07:46 +0100
commit017cb1d5702a32603810545cd74c1da65e35d12d (patch)
tree8a1adc1406b395dd6308e383c670a745df309d62
parent1642d387f30fbef97f93225f11c3e1a6017f6ff1 (diff)
downloadliberty-017cb1d5702a32603810545cd74c1da65e35d12d.tar.gz
liberty-017cb1d5702a32603810545cd74c1da65e35d12d.tar.xz
liberty-017cb1d5702a32603810545cd74c1da65e35d12d.zip
MPD client: tolerate usage while disconnectedorigin/master
If the client is password-protected, this will not automagically make queued up commands work, but it's better than hitting the poller assertion.
-rw-r--r--liberty-proto.c2
1 files changed, 2 insertions, 0 deletions
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);
}