From c233413ccc73c58def0cd08862972ec824957758 Mon Sep 17 00:00:00 2001 From: z3bra Date: Thu, 10 Nov 2016 00:04:56 +0100 Subject: Remove useless call to FD_CLR() This snippet was introduced when the client could send too much data to the core for the transfer. The new toxcore API introduces a callback triggered when the core is ready to send more data. It means we don't need to keep track of a local buffer anymore, and simply read from the file_in FIFO when the core is ready. --- ratox.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 471e9b4..71d8df8 100644 --- a/ratox.c +++ b/ratox.c @@ -1613,23 +1613,6 @@ loop(void) } } - /* If we hit the receiver too hard, we will run out of - * local buffer slots. In that case tox_file_send_chunk() - * will return -1 and we will have to queue the buffer to - * send it later. If this is the last buffer read from - * the FIFO, then select() won't make the fd readable again - * so we have to check if there's anything pending to be - * sent. - */ - TAILQ_FOREACH(f, &friendhead, entry) { - if (tox_friend_get_connection_status(tox, f->num, NULL) == 0) - continue; - if (f->tx.state != TRANSFER_INPROGRESS) - continue; - if (f->tx.state == TRANSFER_NONE) - FD_CLR(f->fd[FFILE_IN], &rfds); - } - /* Accept pending transfers if any */ TAILQ_FOREACH(f, &friendhead, entry) { if (tox_friend_get_connection_status(tox, f->num, NULL) == 0) -- cgit v1.2.3