]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix ident timeouts to work properly when the connect succeeds but nothing comes in...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 18 Aug 2006 23:49:10 +0000 (23:49 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 18 Aug 2006 23:49:10 +0000 (23:49 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4976 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_ident.cpp

index a7ffe60529f1119fd30e6faf8c03738a09922fc4..6c2f0cf525133974e1351ca8b225af0b369f1223 100644 (file)
@@ -41,8 +41,9 @@ class RFC1413 : public InspSocket
        userrec* u;              // user record that the lookup is associated with
        int ufd;
 
        userrec* u;              // user record that the lookup is associated with
        int ufd;
 
-       RFC1413(InspIRCd* SI, userrec* user, int maxtime) : InspSocket(SI, user->GetIPString(), 113, false, maxtime), u(user), ufd(user->GetFd())
+       RFC1413(InspIRCd* SI, userrec* user, int maxtime) : InspSocket(SI, user->GetIPString(), 113, false, maxtime), u(user)
        {
        {
+               ufd = user->GetFd();
        }
 
        virtual void OnTimeout()
        }
 
        virtual void OnTimeout()
@@ -137,6 +138,7 @@ class RFC1413 : public InspSocket
 
        virtual bool OnConnected()
        {
 
        virtual bool OnConnected()
        {
+               Instance->Log(DEBUG,"Ident: connected");
                if (u && (Instance->SE->GetRef(ufd) == u))
                {
                        uslen = sizeof(sock_us);
                if (u && (Instance->SE->GetRef(ufd) == u))
                {
                        uslen = sizeof(sock_us);
@@ -230,6 +232,14 @@ class ModuleIdent : public Module
                 * have an ident field any more.
                 */
                RFC1413* ident;
                 * have an ident field any more.
                 */
                RFC1413* ident;
+               if (user->GetExt("ident_data", ident))
+               {
+                       if (ident->timeout_end > ServerInstance->Time())
+                       {
+                               ident->u = NULL;
+                               ServerInstance->RemoveSocket(ident);
+                       }
+               }
                return (!user->GetExt("ident_data", ident));
        }
 
                return (!user->GetExt("ident_data", ident));
        }