Simplify mpd_client_on_timeout()

No real need to ping the daemon.
This commit is contained in:
Přemysl Eric Janouch 2016-10-11 09:11:06 +02:00
parent b3d9ac2514
commit fb75841154
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 5 additions and 8 deletions

13
mpd.c
View File

@ -509,15 +509,12 @@ static void
mpd_client_on_timeout (void *user_data) mpd_client_on_timeout (void *user_data)
{ {
struct mpd_client *self = 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 // Abort and immediately restore the current idle so that MPD doesn't
// TODO: set another timer to make sure the ping reply arrives // disconnect us, even though the documentation says this won't happen.
mpd_client_send_command (self, "ping", NULL); // Just sending this out should bring a dead connection down over TCP.
mpd_client_add_task (self, NULL, NULL); // TODO: set another timer to make sure we get a reply
mpd_client_idle (self, self->idling_subsystems);
// Restore the incriminating idle immediately
mpd_client_idle (self, subsystems);
} }
/// When not expecting to send any further commands, you should call this /// When not expecting to send any further commands, you should call this