1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 08:16:39 +02:00

Cleaned up some of the socket code, cleaned up the pipe engines, added support for binary sockets, and cleaned up the asynch connect/accept code

This commit is contained in:
Adam
2011-08-21 13:38:42 -04:00
parent 4fcb371bc8
commit 2eb708e5ad
16 changed files with 738 additions and 725 deletions
+12 -4
View File
@@ -96,19 +96,27 @@ void SocketEngine::Process()
{
Socket *s = it->second;
if (FD_ISSET(s->GetFD(), &efdset) || FD_ISSET(s->GetFD(), &rfdset) || FD_ISSET(s->GetFD(), &wfdset))
bool has_read = FD_ISSET(s->GetFD(), &rfdset), has_write = FD_ISSET(s->GetFD(), &wfdset), has_error = FD_ISSET(s->GetFD(), &efdset);
if (has_read || has_write || has_error)
++processed;
if (s->HasFlag(SF_DEAD))
continue;
if (FD_ISSET(s->GetFD(), &efdset))
if (has_error)
{
s->ProcessError();
s->SetFlag(SF_DEAD);
continue;
}
if (FD_ISSET(s->GetFD(), &rfdset) && !s->ProcessRead())
if (!s->Process())
continue;
if (has_read && !s->ProcessRead())
s->SetFlag(SF_DEAD);
if (FD_ISSET(s->GetFD(), &wfdset) && !s->ProcessWrite())
if (has_write && !s->ProcessWrite())
s->SetFlag(SF_DEAD);
}