summaryrefslogtreecommitdiff
path: root/src/sockets.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-01 13:32:38 -0400
committerAdam <Adam@anope.org>2012-11-01 14:47:23 -0400
commit90930619bc124e94bac5048c0b13c3f4748b559d (patch)
treecbe2325f6295aa188a6dd0f0d56d336eab060bbe /src/sockets.cpp
parent5b1c8230191fa626ef9210c5035f14a8df4c0ed6 (diff)
Fixed quite a bit of dumbness with m_ssl. Had to
modify socketengines to allow polling for write & no read, but is it cleaner now. Made m_httpd able to listen using SSL.
Diffstat (limited to 'src/sockets.cpp')
-rw-r--r--src/sockets.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sockets.cpp b/src/sockets.cpp
index 665db5ca2..5cf567de5 100644
--- a/src/sockets.cpp
+++ b/src/sockets.cpp
@@ -384,7 +384,7 @@ void SocketIO::Connect(ConnectionSocket *s, const Anope::string &target, int por
s->OnError(Anope::LastError());
else
{
- SocketEngine::MarkWritable(s);
+ SocketEngine::Change(s, true, SF_WRITABLE);
s->SetFlag(SF_CONNECTING);
}
}
@@ -444,16 +444,19 @@ Socket::Socket(int sock, bool ipv6, int type) : Flags<SocketFlag>(SocketFlagStri
else
this->Sock = sock;
this->SetNonBlocking();
- SocketEngine::AddSocket(this);
+ SocketEngine::Sockets[this->Sock] = this;
+ SocketEngine::Change(this, true, SF_READABLE);
}
/** Default destructor
*/
Socket::~Socket()
{
- SocketEngine::DelSocket(this);
+ SocketEngine::Change(this, false, SF_READABLE);
+ SocketEngine::Change(this, false, SF_WRITABLE);
anope_close(this->Sock);
this->IO->Destroy();
+ SocketEngine::Sockets.erase(this->Sock);
}
/** Get the socket FD for this socket