summaryrefslogtreecommitdiff
path: root/modules/socketengines/m_socketengine_select.cpp
diff options
context:
space:
mode:
authorNaram Qashat <cyberbotx@cyberbotx.com>2010-07-25 21:58:20 -0400
committerNaram Qashat <cyberbotx@cyberbotx.com>2010-07-25 21:58:20 -0400
commitae38212c1ce829c783edf971081c90137abb49a0 (patch)
tree5c652d9cdc38103dec6fa112d57fca882b4e3e44 /modules/socketengines/m_socketengine_select.cpp
parent15d7f0f6fe8bb903275f603f734c13f65f3aa906 (diff)
Epic commit to replace most of the strings in Anope with a single Anope::string class, plus some other little fixes here and there. If you follow 1.9.x development and are testing things, THIS is one of those things that NEEDS testing.
Diffstat (limited to 'modules/socketengines/m_socketengine_select.cpp')
-rw-r--r--modules/socketengines/m_socketengine_select.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/modules/socketengines/m_socketengine_select.cpp b/modules/socketengines/m_socketengine_select.cpp
index c7346f87c..e713915a3 100644
--- a/modules/socketengines/m_socketengine_select.cpp
+++ b/modules/socketengines/m_socketengine_select.cpp
@@ -79,31 +79,19 @@ class SocketEngineSelect : public SocketEngineBase
s->SetFlag(SF_DEAD);
continue;
}
- if (FD_ISSET(s->GetSock(), &rfdset))
- {
- if (!s->ProcessRead())
- {
- s->SetFlag(SF_DEAD);
- }
- }
- if (FD_ISSET(s->GetSock(), &wfdset))
- {
- if (!s->ProcessWrite())
- {
- s->SetFlag(SF_DEAD);
- }
- }
+ if (FD_ISSET(s->GetSock(), &rfdset) && !s->ProcessRead())
+ s->SetFlag(SF_DEAD);
+ if (FD_ISSET(s->GetSock(), &wfdset) && !s->ProcessWrite())
+ s->SetFlag(SF_DEAD);
}
- for (std::map<int, Socket *>::iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end;)
+ for (std::map<int, Socket *>::iterator it = Sockets.begin(), it_end = Sockets.end(); it != it_end; )
{
Socket *s = it->second;
++it;
if (s->HasFlag(SF_DEAD))
- {
delete s;
- }
}
}
}
@@ -114,8 +102,9 @@ class ModuleSocketEngineSelect : public Module
SocketEngineSelect *engine;
public:
- ModuleSocketEngineSelect(const std::string &modname, const std::string &creator) : Module(modname, creator)
+ ModuleSocketEngineSelect(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator)
{
+ this->SetAuthor("Anope");
this->SetPermanent(true);
this->SetType(SOCKETENGINE);
@@ -131,4 +120,3 @@ class ModuleSocketEngineSelect : public Module
};
MODULE_INIT(ModuleSocketEngineSelect)
-