diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/userprocess.cpp | 1 | ||||
-rw-r--r-- | src/users.cpp | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 1d2187165..7cdb85cd2 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -266,6 +266,7 @@ void InspIRCd::DoBackgroundUserStuff(time_t TIME) bool ready = AllModulesReportReady(curr); if ((TIME > curr->signon) && (curr->registered == REG_NICKUSER) && (ready)) { + curr->WriteServ("NOTICE Auth :*** Could not resolve your hostname: Request timed out; using your IP address (%s) instead.", curr->GetIPString()); curr->dns_done = true; this->stats->statsDnsBad++; curr->FullConnect(); diff --git a/src/users.cpp b/src/users.cpp index 48260bd1f..1f8a62eec 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -240,9 +240,14 @@ void UserResolver::OnError(ResolverError e, const std::string &errormessage) { if (ServerInstance->SE->GetRef(this->bound_fd) == this->bound_user) { - /* 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; + /* 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; + } } } |