1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 12:36:38 +02:00

Made socket engine stop processing once all sockets have been checked

This commit is contained in:
Adam
2010-12-27 00:41:04 -05:00
parent 87d0fc8bb5
commit fce491e18c
2 changed files with 9 additions and 2 deletions
@@ -73,10 +73,13 @@ class SocketEngineSelect : public SocketEngineBase
}
else if (sresult)
{
for (std::map<int, Socket *>::const_iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end; ++it)
int processed = 0;
for (std::map<int, Socket *>::const_iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end && processed != sresult; ++it)
{
Socket *s = it->second;
if (FD_ISSET(s->GetFD(), &efdset) || FD_ISSET(s->GetFD(), &rfdset) || FD_ISSET(s->GetFD(), &wfdset))
++processed;
if (s->HasFlag(SF_DEAD))
continue;
if (FD_ISSET(s->GetFD(), &efdset))