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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user