URI: 
       tOnly monitor FIFOs for friends that are online - ratox - FIFO based tox client
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 0c916898347ff1887801443526f20136190a947d
   DIR parent 15e5fb0021d87d4672ede019c85403fbf7d1face
  HTML Author: sin <sin@2f30.org>
       Date:   Tue, 16 Sep 2014 13:45:35 +0100
       
       Only monitor FIFOs for friends that are online
       
       Side-effect: If you send a file to a friend that is offline,
       tthe write will block() until the friend comes online at which point
       tthe file transfer will begin.
       
       Diffstat:
         M ratatox.c                           |      13 +++++++++----
       
       1 file changed, 9 insertions(+), 4 deletions(-)
       ---
   DIR diff --git a/ratatox.c b/ratatox.c
       t@@ -891,10 +891,13 @@ loop(void)
                        fdmax = STDIN_FILENO;
        
                        TAILQ_FOREACH(f, &friendhead, entry) {
       -                        for (i = 0; i < NR_FIFOS; i++) {
       -                                FD_SET(f->fd[i], &rfds);
       -                                if (f->fd[i] > fdmax)
       -                                        fdmax = f->fd[i];
       +                        /* Only monitor friends that are online */
       +                        if (tox_get_friend_connection_status(tox, f->fid) == 1) {
       +                                for (i = 0; i < NR_FIFOS; i++) {
       +                                        FD_SET(f->fd[i], &rfds);
       +                                        if (f->fd[i] > fdmax)
       +                                                fdmax = f->fd[i];
       +                                }
                                }
                        }
        
       t@@ -917,6 +920,8 @@ loop(void)
                         * sent.
                         */
                        TAILQ_FOREACH(f, &friendhead, entry) {
       +                        if (tox_get_friend_connection_status(tox, f->fid) == 0)
       +                                continue;
                                if (f->t.state == TRANSFER_NONE)
                                        continue;
                                if (f->t.pending == 0)