summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-11 09:11:06 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-11 10:58:38 +0200
commitfb75841154c0eb20d525b0363781520df0560fac (patch)
tree8e73ebe5b9c1b65d67c0c2d4db38608359c5e53f
parentb3d9ac251491f88bbc02694250fa4ce4620527ec (diff)
downloadnncmpp-fb75841154c0eb20d525b0363781520df0560fac.tar.gz
nncmpp-fb75841154c0eb20d525b0363781520df0560fac.tar.xz
nncmpp-fb75841154c0eb20d525b0363781520df0560fac.zip
Simplify mpd_client_on_timeout()
No real need to ping the daemon.
-rw-r--r--mpd.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/mpd.c b/mpd.c
index 02b1d8f..d48bcdb 100644
--- a/mpd.c
+++ b/mpd.c
@@ -509,15 +509,12 @@ static void
mpd_client_on_timeout (void *user_data)
{
struct mpd_client *self = user_data;
- unsigned subsystems = self->idling_subsystems;
- // Just sending this out should bring a dead connection down over TCP
- // TODO: set another timer to make sure the ping reply arrives
- mpd_client_send_command (self, "ping", NULL);
- mpd_client_add_task (self, NULL, NULL);
-
- // Restore the incriminating idle immediately
- mpd_client_idle (self, subsystems);
+ // Abort and immediately restore the current idle so that MPD doesn't
+ // disconnect us, even though the documentation says this won't happen.
+ // Just sending this out should bring a dead connection down over TCP.
+ // TODO: set another timer to make sure we get a reply
+ mpd_client_idle (self, self->idling_subsystems);
}
/// When not expecting to send any further commands, you should call this