From 952d7e4aa9f86bd784c0fbef3ce8611ccafe8b6a Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 13 Dec 2023 19:52:01 +0100 Subject: Reformatted net_flush_connection() --- FICS/network.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/FICS/network.c b/FICS/network.c index 592a977..de9d99c 100644 --- a/FICS/network.c +++ b/FICS/network.c @@ -155,23 +155,25 @@ PRIVATE void net_flush_all_connections(void) } } -PRIVATE void net_flush_connection(int fd) +PRIVATE void +net_flush_connection(int fd) { - int which; - fd_set writefds; - struct timeval to; + fd_set writefds; + int which; + struct timeval to; - if (((which = findConnection(fd)) >= 0) && (con[which].sndbufpos)) { - FD_ZERO(&writefds); - FD_SET(con[which].outFd, &writefds); - to.tv_usec = 0; - to.tv_sec = 0; - select(no_file, NULL, &writefds, NULL, &to); - if (FD_ISSET(con[which].outFd, &writefds)) { - net_flushme(which); - } - } - return; + if ((which = findConnection(fd)) >= 0 && con[which].sndbufpos) { + FD_ZERO(&writefds); + FD_SET(con[which].outFd, &writefds); + + to.tv_usec = 0; + to.tv_sec = 0; + + select(no_file, NULL, &writefds, NULL, &to); + + if (FD_ISSET(con[which].outFd, &writefds)) + net_flushme(which); + } } PRIVATE int -- cgit v1.2.3