clean up dead connections regularly

This commit is contained in:
John
2021-11-12 19:14:33 +01:00
parent 93542a4f90
commit bb8e9ed06a
+5
View File
@@ -275,7 +275,11 @@ void Network::run() {
}
#endif
#endif
int cleanupCnt = 0;
while (true) {
if (++cleanupCnt > 10) {
cleanConnections();
}
#ifdef HAVE_PPOLL
// wait for new fd event
ret = ppoll(fds, nfds, &tdiff, nullptr);
@@ -289,6 +293,7 @@ void Network::run() {
#endif
if (ret == 0) {
cleanConnections();
cleanupCnt = 0;
continue;
}
bool newData = false, isHttp = false;