]> git.pond.sub.org Git - empserver/blobdiff - src/lib/player/recvclient.c
Add deadline support to io_output(), io_output_if_queue_long()
[empserver] / src / lib / player / recvclient.c
index 2f798cd558bc8ba7422dcf8348d8af0400a135fc..97cc861771329e5bb51e656eff414b85ea0f2d35 100644 (file)
@@ -61,6 +61,7 @@ int
 recvclient(char *cmd, int size)
 {
     int count, res;
+    time_t deadline;
 
     count = -1;
     while (!player->aborted) {
@@ -80,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.
         */
-       while (io_output(player->iop,
-                        player->may_sleep >= PLAYER_SLEEP_ON_INPUT) > 0)
+       deadline = (time_t)(player->may_sleep >= PLAYER_SLEEP_ON_INPUT
+                           ? -1 : 0);
+       while (io_output(player->iop, deadline) > 0)
            ;
 
        /*