From 033cf7bfdbe73dbd446efc7b08f58bf6c7262bf6 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 18 Aug 2006 23:49:10 +0000 Subject: Fix ident timeouts to work properly when the connect succeeds but nothing comes in as a reply to the ident request git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4976 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_ident.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index a7ffe6052..6c2f0cf52 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -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); @@ -230,6 +232,14 @@ class ModuleIdent : public Module * 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)); } -- cgit v1.2.3