]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ident.cpp
Annotations
[user/henk/code/inspircd.git] / src / modules / m_ident.cpp
index a7ffe60529f1119fd30e6faf8c03738a09922fc4..93fa498fcaacd643e94410314a779e7e86686102 100644 (file)
@@ -41,8 +41,9 @@ class RFC1413 : public InspSocket
        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()
@@ -137,6 +138,7 @@ class RFC1413 : public InspSocket
 
        virtual bool OnConnected()
        {
+               Instance->Log(DEBUG,"Ident: connected");
                if (u && (Instance->SE->GetRef(ufd) == u))
                {
                        uslen = sizeof(sock_us);
@@ -210,16 +212,12 @@ class ModuleIdent : public Module
                 */
                user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Looking up your ident...");
                RFC1413* ident = new RFC1413(ServerInstance, user, IdentTimeout);
-               if (ident->GetState() != I_ERROR)
+               if ((ident->GetState() == I_CONNECTING) || (ident->GetState() == I_CONNECTED))
                {
                        user->Extend("ident_data", (char*)ident);
-                       ServerInstance->AddSocket(ident);
                }
                else
-               {
-                       user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using "+std::string(user->ident)+" instead.");
-                       DELETE(ident);
-               }
+                       delete ident;
        }
 
        virtual bool OnCheckReady(userrec* user)
@@ -246,7 +244,6 @@ class ModuleIdent : public Module
                                // a user which has now vanished! To prevent this, set ident::u
                                // to NULL and check it so that we dont write users who have gone away.
                                ident->u = NULL;
-                               ServerInstance->RemoveSocket(ident);
                        }
                }
        }
@@ -265,7 +262,6 @@ class ModuleIdent : public Module
                if (user->GetExt("ident_data", ident))
                {
                        ident->u = NULL;
-                       ServerInstance->RemoveSocket(ident);
                }
        }