1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 05:16:38 +02:00

Added kqueue

This commit is contained in:
Adam
2011-08-28 21:30:49 -04:00
parent 700a585b1b
commit c6d3fbdfab
6 changed files with 165 additions and 39 deletions
+3 -12
View File
@@ -124,13 +124,13 @@ void SocketEngine::Process()
continue;
Socket *s = it->second;
if (s->HasFlag(SF_DEAD))
continue;
if (ev->events & (EPOLLHUP | EPOLLERR))
{
socklen_t sz = sizeof(errno);
getsockopt(s->GetFD(), SOL_SOCKET, SO_ERROR, &errno, &sz);
s->ProcessError();
s->SetFlag(SF_DEAD);
delete s;
continue;
}
@@ -142,15 +142,6 @@ void SocketEngine::Process()
if ((ev->events & EPOLLOUT) && !s->ProcessWrite())
s->SetFlag(SF_DEAD);
}
for (int i = 0; i < total; ++i)
{
epoll_event *ev = &events[i];
std::map<int, Socket *>::iterator it = Sockets.find(ev->data.fd);
if (it == Sockets.end())
continue;
Socket *s = it->second;
if (s->HasFlag(SF_DEAD))
delete s;