summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_ssl_openssl.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-24 15:13:17 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-24 15:13:17 +0000
commit343f12b9b2d4e519b09877f76a00f6a0714509f2 (patch)
treeb51aee0ca78a19fd356cdc2788cab4530c7928c1 /src/modules/extra/m_ssl_openssl.cpp
parent638381c529a2f19c699718234d689e54ad459c97 (diff)
Add stuff so that modules can hook users by altering a pointer in the User class. Note that ssl modules still bind by port, but the idea of doing this change is so we can remove that logic next
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9187 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_ssl_openssl.cpp')
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 610565002..ba32c4013 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -150,8 +150,17 @@ class ModuleSSLOpenSSL : public Module
// Needs the flag as it ignores a plain /rehash
OnRehash(NULL,"ssl");
Implementation eventlist[] = { I_OnRawSocketConnect, I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketRead, I_OnRawSocketWrite, I_OnCleanup, I_On005Numeric,
- I_OnBufferFlushed, I_OnRequest, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_OnUnloadModule, I_OnRehash, I_OnWhois, I_OnPostConnect };
- ServerInstance->Modules->Attach(eventlist, this, 15);
+ I_OnBufferFlushed, I_OnRequest, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_OnUnloadModule, I_OnRehash, I_OnWhois, I_OnPostConnect, I_OnHookUserIO };
+ ServerInstance->Modules->Attach(eventlist, this, 16);
+ }
+
+ virtual void OnHookUserIO(User* user)
+ {
+ if (!user->io && isin(user->GetPort(), listenports))
+ {
+ /* Hook the user with our module */
+ user->io = this;
+ }
}
virtual void OnRehash(User* user, const std::string &param)
@@ -320,6 +329,8 @@ class ModuleSSLOpenSSL : public Module
delete tofree;
user->Shrink("ssl_cert");
}
+
+ user->io = NULL;
}
}