summaryrefslogtreecommitdiff
path: root/modules/socketengines/m_socketengine_select.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-10-01 21:01:49 -0400
committerAdam <Adam@anope.org>2010-10-01 21:01:49 -0400
commitd44f7971b129aa7ba80999f16f17b8c7499686e1 (patch)
treea86d08c3e641ed6b499b53b3bbb74e2a7f5b0dfb /modules/socketengines/m_socketengine_select.cpp
parent70056dd4689eeab4f7a9b31a921e0d7e40d5ed0d (diff)
Rewrote some of the socket code to allow m_ssl to be a service.
This allows modules (xmlrpc) to create and accept SSL connections. Also fixed unloading m_mysql at certain times and made the threading engine always work correctly on Windows.
Diffstat (limited to 'modules/socketengines/m_socketengine_select.cpp')
-rw-r--r--modules/socketengines/m_socketengine_select.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/socketengines/m_socketengine_select.cpp b/modules/socketengines/m_socketengine_select.cpp
index 733547167..b1c1c065f 100644
--- a/modules/socketengines/m_socketengine_select.cpp
+++ b/modules/socketengines/m_socketengine_select.cpp
@@ -26,26 +26,26 @@ class SocketEngineSelect : public SocketEngineBase
void AddSocket(Socket *s)
{
- if (s->GetSock() > MaxFD)
- MaxFD = s->GetSock();
- FD_SET(s->GetSock(), &ReadFDs);
- Sockets.insert(std::make_pair(s->GetSock(), s));
+ if (s->GetFD() > MaxFD)
+ MaxFD = s->GetFD();
+ FD_SET(s->GetFD(), &ReadFDs);
+ Sockets.insert(std::make_pair(s->GetFD(), s));
}
void DelSocket(Socket *s)
{
- if (s->GetSock() == MaxFD)
+ if (s->GetFD() == MaxFD)
--MaxFD;
- FD_CLR(s->GetSock(), &ReadFDs);
- FD_CLR(s->GetSock(), &WriteFDs);
- Sockets.erase(s->GetSock());
+ FD_CLR(s->GetFD(), &ReadFDs);
+ FD_CLR(s->GetFD(), &WriteFDs);
+ Sockets.erase(s->GetFD());
}
void MarkWritable(Socket *s)
{
if (s->HasFlag(SF_WRITABLE))
return;
- FD_SET(s->GetSock(), &WriteFDs);
+ FD_SET(s->GetFD(), &WriteFDs);
s->SetFlag(SF_WRITABLE);
}
@@ -53,7 +53,7 @@ class SocketEngineSelect : public SocketEngineBase
{
if (!s->HasFlag(SF_WRITABLE))
return;
- FD_CLR(s->GetSock(), &WriteFDs);
+ FD_CLR(s->GetFD(), &WriteFDs);
s->UnsetFlag(SF_WRITABLE);
}
@@ -79,15 +79,15 @@ class SocketEngineSelect : public SocketEngineBase
if (s->HasFlag(SF_DEAD))
continue;
- if (FD_ISSET(s->GetSock(), &efdset))
+ if (FD_ISSET(s->GetFD(), &efdset))
{
s->ProcessError();
s->SetFlag(SF_DEAD);
continue;
}
- if (FD_ISSET(s->GetSock(), &rfdset) && !s->ProcessRead())
+ if (FD_ISSET(s->GetFD(), &rfdset) && !s->ProcessRead())
s->SetFlag(SF_DEAD);
- if (FD_ISSET(s->GetSock(), &wfdset) && !s->ProcessWrite())
+ if (FD_ISSET(s->GetFD(), &wfdset) && !s->ProcessWrite())
s->SetFlag(SF_DEAD);
}