+ delete culllist;
+ }
+
+ virtual void OnCleanup(int target_type, void* item)
+ {
+ if(target_type == TYPE_USER)
+ {
+ userrec* user = (userrec*)item;
+
+ if(user->GetExt("ssl", dummy) && isin(user->GetPort(), listenports))
+ {
+ // 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.
+ log(DEBUG, "m_ssl_gnutls.so: Adding user %s to cull list", user->nick);
+ culllist->AddItem(user, "SSL module unloading");
+ }
+ }
+ }
+
+ virtual void OnUnloadModule(Module* mod, const std::string &name)
+ {
+ if(mod == this)
+ {
+ // We're being unloaded, kill all the users added to the cull list in OnCleanup
+ int numusers = culllist->Apply();
+ log(DEBUG, "m_ssl_gnutls.so: Killed %d users for unload of GnuTLS SSL module", numusers);
+
+ for(unsigned int i = 0; i < listenports.size(); i++)
+ ServerInstance->Config->DelIOHook(listenports[i]);
+ }