os: WaitForSomething(): also try to flush out older buffer content

Always try to flush out anything we have, even for clients that had
been stuck for a short while because we've tried to send out too
much at once. If we'd only do it when someting *new* is in the queue,
then those clients might get stuck for long time, until something else
triggers the flush by mere accident.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-07 17:09:16 +02:00
committed by Enrico Weigelt
parent 50037a450d
commit ceeddbd219

View File

@@ -198,8 +198,15 @@ WaitForSomething(Bool are_ready)
timeout = 0;
BlockHandler(&timeout);
if (NewOutputPending)
FlushAllOutput();
/* Always try to flush out anything we have, even for clients that had
been stuck for a short while because we've tried to send out too
much at once. If we'd only do it when someting *new* is in the queue,
then those clients might get stuck for long time, until something else
triggers the flush by mere accident.
*/
FlushAllOutput();
/* keep this check close to select() call to minimize race */
if (dispatchException)
i = -1;