summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-07 20:07:50 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-07 20:07:50 +0000
commit78c14ffcc5429f4855e2f3a6c822a1d37f9f591a (patch)
treeb40781d00ea751f1728090ca0733e6fe334bbf4b /src/modules
parentefee3a4d4ec21a32bb46185e1b997947c9d5daf2 (diff)
Merge the second interface for socket hooking into one, so it's all done by Add/Del/GetIOHook now.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10457 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp16
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp10
-rw-r--r--src/modules/m_xmlsocket.cpp8
3 files changed, 17 insertions, 17 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 93fdcc8a1..d7be8b12b 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -81,10 +81,10 @@ class CommandStartTLS : public Command
}
else
{
- if (!user->io)
+ if (!user->GetIOHook())
{
user->WriteNumeric(670, "%s :STARTTLS successful, go ahead with TLS handshake", user->nick.c_str());
- user->io = Caller;
+ user->AddIOHook(Caller);
Caller->OnRawSocketAccept(user->GetFd(), user->GetIPString(), user->GetPort());
}
else
@@ -303,12 +303,12 @@ class ModuleSSLGnuTLS : public Module
{
User* user = (User*)item;
- if (user->io == this)
+ if (user->GetIOHook() == this)
{
// User is using SSL, they're a local user, and they're using one of *our* SSL ports.
// Potentially there could be multiple SSL modules loaded at once on different ports.
ServerInstance->Users->QuitUser(user, "SSL module unloading");
- user->io = NULL;
+ user->DelIOHook();
}
if (user->GetExt("ssl_cert", dummy))
{
@@ -346,10 +346,10 @@ class ModuleSSLGnuTLS : public Module
virtual void OnHookUserIO(User* user, const std::string &targetip)
{
- if (!user->io && isin(targetip,user->GetPort(),listenports))
+ if (!user->GetIOHook() && isin(targetip,user->GetPort(),listenports))
{
/* Hook the user with our module */
- user->io = this;
+ user->AddIOHook(this);
}
}
@@ -646,7 +646,7 @@ class ModuleSSLGnuTLS : public Module
return;
// Bugfix, only send this numeric for *our* SSL users
- if (dest->GetExt("ssl", dummy) || ((IS_LOCAL(dest) && (dest->io == this))))
+ if (dest->GetExt("ssl", dummy) || ((IS_LOCAL(dest) && (dest->GetIOHook() == this))))
{
ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick.c_str(), dest->nick.c_str());
}
@@ -929,7 +929,7 @@ class ModuleSSLGnuTLS : public Module
if (data->user->Shrink("tls"))
{
/* Not in our spec?!?! */
- data->user->io = this;
+ data->user->AddIOHook(this);
OnRawSocketAccept(data->user->GetFd(), data->user->GetIPString(),
data->user->GetPort());
}
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 63159c519..d234cb6e5 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -167,10 +167,10 @@ class ModuleSSLOpenSSL : public Module
virtual void OnHookUserIO(User* user, const std::string &targetip)
{
- if (!user->io && isin(targetip,user->GetPort(), listenports))
+ if (!user->GetIOHook() && isin(targetip,user->GetPort(), listenports))
{
/* Hook the user with our module */
- user->io = this;
+ user->AddIOHook(this);
}
}
@@ -321,12 +321,12 @@ class ModuleSSLOpenSSL : public Module
{
User* user = (User*)item;
- if (user->io == this)
+ if (user->GetIOHook() == this)
{
// User is using SSL, they're a local user, and they're using one of *our* SSL ports.
// Potentially there could be multiple SSL modules loaded at once on different ports.
ServerInstance->Users->QuitUser(user, "SSL module unloading");
- user->io = NULL;
+ user->DelIOHook()
}
if (user->GetExt("ssl_cert", dummy))
{
@@ -687,7 +687,7 @@ class ModuleSSLOpenSSL : public Module
return;
// Bugfix, only send this numeric for *our* SSL users
- if (dest->GetExt("ssl", dummy) || ((IS_LOCAL(dest) && dest->io == this)))
+ if (dest->GetExt("ssl", dummy) || ((IS_LOCAL(dest) && dest->GetIOHook() == this)))
{
ServerInstance->SendWhoisLine(source, dest, 320, "%s %s :is using a secure connection", source->nick.c_str(), dest->nick.c_str());
}
diff --git a/src/modules/m_xmlsocket.cpp b/src/modules/m_xmlsocket.cpp
index cc14dee97..a60512d30 100644
--- a/src/modules/m_xmlsocket.cpp
+++ b/src/modules/m_xmlsocket.cpp
@@ -102,8 +102,8 @@ class ModuleXMLSocket : public Module
if(target_type == TYPE_USER)
{
User* user = (User*)item;
- if(user->io == this)
- user->io = NULL;
+ if(user->GetIOHook() == this)
+ user->DelIOHook();
}
}
@@ -114,10 +114,10 @@ class ModuleXMLSocket : public Module
virtual void OnHookUserIO(User* user, const std::string &targetip)
{
- if (!user->io && isin(targetip,user->GetPort(),listenports))
+ if (!user->GetIOHook() && isin(targetip,user->GetPort(),listenports))
{
/* Hook the user with our module */
- user->io = this;
+ user->AddIOHook(this);
}
}