From 31b785cb03d616a7989c57279d76f05f8d9aa9c3 Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 8 Feb 2008 22:45:12 +0000 Subject: Fix low-risk potential memory leak: if a webirc client with valid cgiirc block connects, issues /webirc, and quits before fully connecting, memory will be leaked. OnUserQuit is only triggered for fully connected users, use OnUserDisconnect otherwise. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8852 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cgiirc.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 3d0c48b7c..e854b8d4e 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -40,6 +40,17 @@ public: }; typedef std::vector CGIHostlist; +/* + * WEBIRC + * This is used for the webirc method of CGIIRC auth, and is (really) the best way to do these things. + * Syntax: WEBIRC password client hostname ip + * Where password is a shared key, client is the name of the "client" and version (e.g. cgiirc), hostname + * is the resolved host of the client issuing the command and IP is the real IP of the client. + * + * How it works: + * To tie in with the rest of cgiirc module, and to avoid race conditions, /webirc is only processed locally + * and simply sets metadata on the user, which is later decoded on full connect to give something meaningful. + */ class CommandWebirc : public Command { InspIRCd* Me; @@ -134,7 +145,7 @@ public: mycommand = new CommandWebirc(Me, Hosts, NotifyOpers); ServerInstance->AddCommand(mycommand); - Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCleanup, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_OnUserQuit, I_OnUserConnect }; + Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCleanup, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_OnUserDisconnect, I_OnUserConnect }; ServerInstance->Modules->Attach(eventlist, this, 7); } @@ -240,7 +251,7 @@ public: } } - virtual void OnUserQuit(User* user, const std::string &message, const std::string &oper_message) + virtual void OnUserDisconnect(User* user) { OnCleanup(TYPE_USER, user); } -- cgit v1.2.3