From 41c5e43ff2e50131778714c1f4ce5d04adb82fa9 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 28 May 2014 14:01:00 +0200 Subject: [PATCH] m_ident Close the ident socket when the object is culled instead of using hooks --- src/modules/m_ident.cpp | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index b86ed2cbe..3e87b8c5a 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -263,6 +263,12 @@ class IdentRequestSocket : public EventHandler } } } + + CullResult cull() CXX11_OVERRIDE + { + Close(); + return EventHandler::cull(); + } }; class ModuleIdent : public Module @@ -360,28 +366,6 @@ class ModuleIdent : public Module return MOD_RES_DENY; return MOD_RES_PASSTHRU; } - - void OnCleanup(int target_type, void *item) CXX11_OVERRIDE - { - /* Module unloading, tidy up users */ - if (target_type == TYPE_USER) - { - LocalUser* user = IS_LOCAL((User*) item); - if (user) - OnUserDisconnect(user); - } - } - - void OnUserDisconnect(LocalUser *user) CXX11_OVERRIDE - { - /* User disconnect (generic socket detatch event) */ - IdentRequestSocket *isock = ext.get(user); - if (isock) - { - isock->Close(); - ext.unset(user); - } - } }; MODULE_INIT(ModuleIdent) -- 2.39.2