diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:48:23 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:48:23 +0000 |
commit | c4cb1f9477b1fbf8662bedb1c36f84ff6f87e1f3 (patch) | |
tree | b2470d6e00d446f161b42523c177d2109059e7fa /src | |
parent | ca749a589afc4f12de4bfb0f63591a49e3703372 (diff) |
Change OnHookUserIO to OnHookIO, making it usable for more than User* and less picky on string matching
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11628 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/listensocket.cpp | 2 | ||||
-rw-r--r-- | src/modules.cpp | 2 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 6 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 6 | ||||
-rw-r--r-- | src/usermanager.cpp | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/listensocket.cpp b/src/listensocket.cpp index ed99c2787..663f912e6 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -148,5 +148,5 @@ void ListenSocketBase::HandleEvent(EventType e, int err) void ClientListenSocket::OnAcceptReady(int nfd) { - ServerInstance->Users->AddUser(ServerInstance, nfd, false, &client, &server); + ServerInstance->Users->AddUser(ServerInstance, nfd, this, &client, &server); } diff --git a/src/modules.cpp b/src/modules.cpp index ad7efdb06..701b76ae2 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -196,7 +196,7 @@ void Module::OnText(User*, void*, int, const std::string&, char, CUList&) { } void Module::OnRunTestSuite() { } void Module::OnNamesListItem(User*, User*, Channel*, std::string&, std::string&) { } int Module::OnNumeric(User*, unsigned int, const std::string&) { return 0; } -void Module::OnHookUserIO(User*) { } +void Module::OnHookIO(EventHandler*, ListenSocketBase*) { } bool Module::OnHostCycle(User* user) { return false; } ModuleManager::ModuleManager(InspIRCd* Ins) : ModCount(0), Instance(Ins) diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 1c90428b2..7e3b62671 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -132,7 +132,7 @@ class ModuleSSLGnuTLS : public Module Implementation eventlist[] = { I_On005Numeric, I_OnRawSocketConnect, I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketRead, I_OnRawSocketWrite, I_OnCleanup, I_OnBufferFlushed, I_OnRequest, I_OnUnloadModule, I_OnRehash, I_OnModuleRehash, - I_OnPostConnect, I_OnEvent, I_OnHookUserIO }; + I_OnPostConnect, I_OnEvent, I_OnHookIO }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); ServerInstance->AddCommand(&starttls); @@ -346,9 +346,9 @@ class ModuleSSLGnuTLS : public Module output.append(" STARTTLS"); } - virtual void OnHookUserIO(User* user) + virtual void OnHookIO(EventHandler* user, ListenSocketBase* lsb) { - if (!user->GetIOHook() && isin(user->GetServerIP(),user->GetServerPort(),listenports)) + if (!user->GetIOHook() && isin(lsb->GetIP(),lsb->GetPort(),listenports)) { /* Hook the user with our module */ user->AddIOHook(this); diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 55b7d8416..fc0de61f4 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -153,13 +153,13 @@ class ModuleSSLOpenSSL : public Module Implementation eventlist[] = { I_OnRawSocketConnect, I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketRead, I_OnRawSocketWrite, I_OnCleanup, I_On005Numeric, I_OnBufferFlushed, I_OnRequest, I_OnUnloadModule, I_OnRehash, I_OnModuleRehash, - I_OnPostConnect, I_OnHookUserIO }; + I_OnPostConnect, I_OnHookIO }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - virtual void OnHookUserIO(User* user) + virtual void OnHookIO(EventHandler* user, ListenSocketBase* lsb) { - if (!user->GetIOHook() && isin(user->GetServerIP(),user->GetServerPort(), listenports)) + if (!user->GetIOHook() && isin(lsb->GetIP(),lsb->GetPort(),listenports)) { /* Hook the user with our module */ user->AddIOHook(this); diff --git a/src/usermanager.cpp b/src/usermanager.cpp index f62daf892..a31ac086e 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -18,7 +18,7 @@ #include "bancache.h" /* add a client connection to the sockets list */ -void UserManager::AddUser(InspIRCd* Instance, int socket, bool iscached, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) +void UserManager::AddUser(InspIRCd* Instance, int socket, ClientListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) { /* NOTE: Calling this one parameter constructor for User automatically * allocates a new UUID and places it in the hash_map. @@ -40,7 +40,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, bool iscached, irc::so memcpy(&New->server_sa, server, sizeof(irc::sockets::sockaddrs)); /* Give each of the modules an attempt to hook the user for I/O */ - FOREACH_MOD_I(Instance, I_OnHookUserIO, OnHookUserIO(New)); + FOREACH_MOD_I(Instance, I_OnHookIO, OnHookIO(New, via)); if (New->GetIOHook()) { |