summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-05-28 14:01:00 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-05-28 14:01:00 +0200
commit41c5e43ff2e50131778714c1f4ce5d04adb82fa9 (patch)
tree991fa49824cfb8f672791ac4fc6affa0d5c3a00b
parentbde1420e5a5f6ac8a4fbe2d8c6173abb693eb99f (diff)
m_ident Close the ident socket when the object is culled instead of using hooks
-rw-r--r--src/modules/m_ident.cpp28
1 files 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)