- ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host.c_str(), parameters[2].c_str(), user->host.c_str());
+ ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick.c_str(), user->host.c_str(), newhost.c_str(), user->host.c_str());
// Check if we're happy with the provided hostname. If it's problematic then make sure we won't set a host later, just the IP
- if (parameters[2].length() < 64)
+ if (host_ok)
webirc_hostname.set(user, parameters[2]);
else
webirc_hostname.unset(user);
@@ -130,8+134,12 @@ class CGIResolver : public Resolver
{
/* Check the user still exists */
User* them = ServerInstance->FindUUID(theiruid);
- if (them)
+ if ((them) && (!them->quitting))
{
+ LocalUser* lu = IS_LOCAL(them);
+ if (!lu)
+ return;
+
if (notify)
ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick.c_str(), them->host.c_str(), result.c_str(), typ.c_str());
@@ -140,17+148,19 @@ class CGIResolver : public Resolver
them->host = result;
them->dhost = result;
them->InvalidateCache();
- them->CheckLines(true);
+ lu->CheckLines(true);
}
}
virtual void OnError(ResolverError e, const std::string &errormessage)
{
+ if (!notify)
+ return;
+
User* them = ServerInstance->FindUUID(theiruid);
- if (them)
+ if ((them) && (!them->quitting))
{
- if (notify)
- ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick.c_str(), them->host.c_str(), typ.c_str());
+ ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick.c_str(), them->host.c_str(), typ.c_str());
}
}
@@ -170,9+180,9 @@ class ModuleCgiIRC : public Module