summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-02 04:46:01 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-02 04:46:01 +0000
commitef960ee420460e437b49e8085c3f1158c60752b9 (patch)
tree76768f393b2041bdc2e2bdde04ffc2b4418a2cbc /src/users.cpp
parent1369c479510140a4d716742262d4455d1abc3ca5 (diff)
Fixed a DNS timeout race condition that could result in a NOTICE AUTH message being sent after connecting (thanks NBKWH5I)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6730 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp11
1 files changed, 8 insertions, 3 deletions
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;
+ }
}
}