]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ident.cpp
Fix memory leak and invalid vtable location on unload of m_sslinfo
[user/henk/code/inspircd.git] / src / modules / m_ident.cpp
index 80f2c0b996ab847ae31578578b1da65984b08d45..690d7b15c58c88389441beef94a0bc94c514dbed 100644 (file)
@@ -79,9 +79,11 @@ class IdentRequestSocket : public EventHandler
        bool done;                      /* True if lookup is finished */
        std::string result;             /* Holds the ident string if done */
  public:
+       time_t age;
 
        IdentRequestSocket(InspIRCd *Server, User* u) : user(u), ServerInstance(Server), result(u->ident)
        {
+               age = ServerInstance->Time();
                socklen_t size = 0;
 
                SetFd(socket(user->server_sa.sa.sa_family, SOCK_STREAM, 0));
@@ -310,7 +312,7 @@ class ModuleIdent : public Module
                        RequestTimeout = 5;
        }
 
-       virtual int OnUserRegister(User *user)
+       virtual ModResult OnUserRegister(User *user)
        {
                for (int j = 0; j < Conf->Enumerate("connect"); j++)
                {
@@ -321,7 +323,7 @@ class ModuleIdent : public Module
                                bool useident = Conf->ReadFlag("connect", "useident", "yes", j);
 
                                if (!useident)
-                                       return 0;
+                                       return MOD_RES_PASSTHRU;
                        }
                }
 
@@ -343,21 +345,21 @@ class ModuleIdent : public Module
                        ServerInstance->Logs->Log("m_ident",DEBUG,"Ident exception: %s", e.GetReason());
                }
 
-               return 0;
+               return MOD_RES_PASSTHRU;
        }
 
        /* This triggers pretty regularly, we can use it in preference to
         * creating a Timer object and especially better than creating a
         * Timer per ident lookup!
         */
-       virtual bool OnCheckReady(User *user)
+       virtual ModResult OnCheckReady(User *user)
        {
                /* Does user have an ident socket attached at all? */
                IdentRequestSocket *isock = NULL;
                if (!user->GetExt("ident_socket", isock))
                {
                        ServerInstance->Logs->Log("m_ident",DEBUG, "No ident socket :(");
-                       return true;
+                       return MOD_RES_PASSTHRU;
                }
 
                ServerInstance->Logs->Log("m_ident",DEBUG, "Has ident_socket");
@@ -375,14 +377,14 @@ class ModuleIdent : public Module
                         * we call this to clean up the user
                         */
                        OnUserDisconnect(user);
-                       return true;
+                       return MOD_RES_PASSTHRU;
                }
 
                /* Got a result yet? */
                if (!isock->HasResult())
                {
                        ServerInstance->Logs->Log("m_ident",DEBUG, "No result yet");
-                       return false;
+                       return MOD_RES_DENY;
                }
 
                ServerInstance->Logs->Log("m_ident",DEBUG, "Yay, result!");
@@ -398,7 +400,7 @@ class ModuleIdent : public Module
 
                /* The user isnt actually disconnecting, we call this to clean up the user */
                OnUserDisconnect(user);
-               return true;
+               return MOD_RES_PASSTHRU;
        }
 
        virtual void OnCleanup(int target_type, void *item)