From 3c8cda059021ecddb989d5554e0b21cca08056ed Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Fri, 3 Sep 2010 22:58:00 -0400 Subject: Fix resolved hostname not being changed when WEBIRC passes a hostname longer than 64 characters --- src/modules/m_cgiirc.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index f1ead276d..a5144e36d 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -279,24 +279,22 @@ public: { std::string *webirc_hostname = cmd.webirc_hostname.get(user); std::string *webirc_ip = cmd.webirc_ip.get(user); + if (!webirc_ip) + return; + ServerInstance->Users->RemoveCloneCounts(user); + user->SetClientIP(webirc_ip->c_str()); + user->InvalidateCache(); if (webirc_hostname && webirc_hostname->length() < 64) - { - user->host = *webirc_hostname; - user->dhost = *webirc_hostname; - user->InvalidateCache(); - } - if (webirc_ip) - { - ServerInstance->Users->RemoveCloneCounts(user); - user->SetClientIP(webirc_ip->c_str()); - user->InvalidateCache(); - cmd.webirc_ip.unset(user); - ServerInstance->Users->AddLocalClone(user); - ServerInstance->Users->AddGlobalClone(user); - user->SetClass(); - user->CheckClass(); - user->CheckLines(true); - } + user->host = user->dhost = *webirc_hostname; + else + user->host = user->dhost = user->GetIPString(); + user->InvalidateCache(); + ServerInstance->Users->AddLocalClone(user); + ServerInstance->Users->AddGlobalClone(user); + user->SetClass(); + user->CheckClass(); + user->CheckLines(true); + cmd.webirc_ip.unset(user); cmd.webirc_hostname.unset(user); } -- cgit v1.2.3