diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-13 19:54:50 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-13 19:54:50 +0100 |
commit | 0fe88e9419a41d3158869f3c9e98d08e6a84dbee (patch) | |
tree | 9f6a5d974ccc9517652ae3c9efa0f0a836ca243d | |
parent | 952d7e4aa9f86bd784c0fbef3ce8611ccafe8b6a (diff) |
Reformatted net_flush_all_connections()
-rw-r--r-- | FICS/network.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/FICS/network.c b/FICS/network.c index de9d99c..be8a8ae 100644 --- a/FICS/network.c +++ b/FICS/network.c @@ -134,25 +134,30 @@ PRIVATE void net_flushme(int which) } } -PRIVATE void net_flush_all_connections(void) +PRIVATE void +net_flush_all_connections(void) { - int which; - fd_set writefds; - struct timeval to; - - FD_ZERO(&writefds); - for (which = 0; which < MAX_PLAYER; which++) - if (con[which].status == NETSTAT_CONNECTED && con[which].sndbufpos) - FD_SET(con[which].outFd, &writefds); - - to.tv_usec = 0; - to.tv_sec = 0; - select(no_file, NULL, &writefds, NULL, &to); - for (which = 0; which < MAX_PLAYER; which++) { - if (FD_ISSET(con[which].outFd, &writefds)) { - net_flushme(which); - } - } + fd_set writefds; + int which; + struct timeval to; + + FD_ZERO(&writefds); + + for (which = 0; which < MAX_PLAYER; which++) { + if (con[which].status == NETSTAT_CONNECTED && + con[which].sndbufpos) + FD_SET(con[which].outFd, &writefds); + } + + to.tv_usec = 0; + to.tv_sec = 0; + + select(no_file, NULL, &writefds, NULL, &to); + + for (which = 0; which < MAX_PLAYER; which++) { + if (FD_ISSET(con[which].outFd, &writefds)) + net_flushme(which); + } } PRIVATE void |