summaryrefslogtreecommitdiff
path: root/src/user_resolver.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-21 20:09:52 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-21 20:09:52 +0000
commitaf739bfa5fbb8070dd3b0d21bdda493cb3052588 (patch)
treea3e92b9c395c558c15a5b9b745d06f2673397626 /src/user_resolver.cpp
parentf561b32be27117fa16f7123adfd4e767e9e17561 (diff)
Move DNS timeouts into the UserResolver class, where they should have been (but seems to have been overlooked due to the relics of 1.0). This simplifies some stuff :)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8278 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/user_resolver.cpp')
-rw-r--r--src/user_resolver.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/user_resolver.cpp b/src/user_resolver.cpp
index adae765eb..e7ae1ed07 100644
--- a/src/user_resolver.cpp
+++ b/src/user_resolver.cpp
@@ -22,6 +22,7 @@ UserResolver::UserResolver(InspIRCd* Instance, User* user, std::string to_resolv
void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl, bool cached, int resultnum)
{
+ ServerInstance->Log(DEBUG, "Got a result (lookup complete)");
/* We are only interested in the first matching result */
if (resultnum)
return;
@@ -102,16 +103,12 @@ void UserResolver::OnLookupComplete(const std::string &result, unsigned int ttl,
void UserResolver::OnError(ResolverError e, const std::string &errormessage)
{
+ ServerInstance->Log(DEBUG, "Resolver error: " + errormessage);
if (ServerInstance->SE->GetRef(this->bound_fd) == this->bound_user)
{
- /* Since dns timeout is implemented outside of the resolver, this was a race condition that could result in this message being sent *after*
- * the user was fully connected. This check fixes that issue - Special */
- if (!this->bound_user->dns_done)
- {
- /* Error message here */
- this->bound_user->WriteServ("NOTICE Auth :*** Could not resolve your hostname: %s; using your IP address (%s) instead.", errormessage.c_str(), this->bound_user->GetIPString());
- this->bound_user->dns_done = true;
- }
+ this->bound_user->WriteServ("NOTICE Auth :*** Could not resolve your hostname: %s; using your IP address (%s) instead.", errormessage.c_str(), this->bound_user->GetIPString());
+ this->bound_user->dns_done = true;
+ ServerInstance->stats->statsDnsBad++;
}
}