summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel De Graaf <danieldg@inspircd.org>2010-09-03 22:58:00 -0400
committerDaniel De Graaf <danieldg@inspircd.org>2010-09-03 22:58:00 -0400
commit3c8cda059021ecddb989d5554e0b21cca08056ed (patch)
tree677ce0d1c2ff899759e41a3631283b3a1fee1754
parente8f873a96c7cd41b52e25131b0e938ce28ebc1cb (diff)
Fix resolved hostname not being changed when WEBIRC passes a hostname longer than 64 characters
-rw-r--r--src/modules/m_cgiirc.cpp32
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);
}