- std::string* hostname = ph->get(bound_user);
-
- if (hostname == NULL)
- {
- ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "ERROR: User has no hostname attached when doing a forward lookup");
- bound_user->WriteNotice("*** There was an internal error resolving your host, using your IP address (" + bound_user->GetIPString() + ") instead.");
- return;
- }
- else if (hostname->length() <= ServerInstance->Config->Limits.MaxHost)
- {
- /* Hostnames starting with : are not a good thing (tm) */
- if ((*hostname)[0] == ':')
- hostname->insert(0, "0");
-
- bound_user->WriteNotice("*** Found your hostname (" + *hostname + (r->cached ? ") -- cached" : ")"));
- bound_user->ChangeRealHost(hostname->substr(0, ServerInstance->Config->Limits.MaxHost), true);
- }
- else
- {
- bound_user->WriteNotice("*** Your hostname is longer than the maximum of " + ConvToStr(ServerInstance->Config->Limits.MaxHost) + " characters, using your IP address (" + bound_user->GetIPString() + ") instead.");
- }
-
- ph->unset(bound_user);
+ bound_user->WriteNotice("*** Found your hostname (" + this->question.name + (r->cached ? ") -- cached" : ")"));
+ bound_user->ChangeRealHost(this->question.name, true);