From 4d59881505f5771de5b3e0f7d42ffaeecb69b9bd Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 11 Mar 2012 12:35:18 +0100 Subject: [PATCH] Fix recvclient() to obey max_idle for output, too recvclient() flushes the output queue before receiving input. The receive obeys max_idle, the flush doesn't. Broken in commit 08b94556 (v4.3.20) "Reimplement max_idle without a separate thread". Until then, the idle thread aborted a stuck attempt to flush output. --- src/lib/player/recvclient.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/player/recvclient.c b/src/lib/player/recvclient.c index 7dacb4508..f9f345348 100644 --- a/src/lib/player/recvclient.c +++ b/src/lib/player/recvclient.c @@ -81,8 +81,9 @@ recvclient(char *cmd, int size) * Flush all queued output before potentially sleeping in * io_input(), to make sure player sees the prompt. */ - deadline = (time_t)(player->may_sleep >= PLAYER_SLEEP_ON_INPUT - ? -1 : 0); + deadline = player->curup + minutes(max_idle); + if (player->may_sleep < PLAYER_SLEEP_ON_INPUT) + deadline = 0; while (io_output(player->iop, deadline) > 0) ; -- 2.43.0