diff options
author | Daniel De Graaf <danieldg@inspircd.org> | 2010-09-03 22:58:00 -0400 |
---|---|---|
committer | Daniel De Graaf <danieldg@inspircd.org> | 2010-09-03 22:58:00 -0400 |
commit | 3c8cda059021ecddb989d5554e0b21cca08056ed (patch) | |
tree | 677ce0d1c2ff899759e41a3631283b3a1fee1754 | |
parent | e8f873a96c7cd41b52e25131b0e938ce28ebc1cb (diff) |
Fix resolved hostname not being changed when WEBIRC passes a hostname longer than 64 characters
-rw-r--r-- | src/modules/m_cgiirc.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
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); } |