summaryrefslogtreecommitdiff
path: root/src/coremods/core_hostname_lookup.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-10-30 19:34:56 +0000
committerPeter Powell <petpow@saberuk.com>2017-10-31 11:48:25 +0000
commit906260c24f7818fb7cf15a0371d760acb1254113 (patch)
tree35b90b760b2a62dd7515dfbc70a9c1033f3c513a /src/coremods/core_hostname_lookup.cpp
parentb047c903da20862783b50af73594cce1592cbbfe (diff)
Make core_hostname_lookup redo the lookup when a user's IP changes.
This removes the need to do lookups in the cgiirc module. This is useful as relying on gateways to do proper DNS checks is unreliable and has resulted in issues like 5fc4403f62. Its more sane if we do our own lookups. This change has been okayed by multiple WEBIRC gateway authors so I don't think it will cause many problems.
Diffstat (limited to 'src/coremods/core_hostname_lookup.cpp')
-rw-r--r--src/coremods/core_hostname_lookup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp
index 2a8426be9..4ec88698e 100644
--- a/src/coremods/core_hostname_lookup.cpp
+++ b/src/coremods/core_hostname_lookup.cpp
@@ -145,7 +145,7 @@ class UserResolver : public DNS::Request
hostname->insert(0, "0");
bound_user->WriteNotice("*** Found your hostname (" + *hostname + (r->cached ? ") -- cached" : ")"));
- bound_user->ChangeRealHost(hostname->substr(ServerInstance->Config->Limits.MaxHost), true);
+ bound_user->ChangeRealHost(hostname->substr(0, ServerInstance->Config->Limits.MaxHost), true);
}
else
{
@@ -191,7 +191,7 @@ class ModuleHostnameLookup : public Module
ph = &ptrHosts;
}
- void OnUserInit(LocalUser *user) CXX11_OVERRIDE
+ void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE
{
if (!DNS || !user->MyClass->resolvehostnames)
{