diff options
-rw-r--r-- | include/users.h | 5 | ||||
-rw-r--r-- | src/users.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/users.h b/include/users.h index f1184ea24..c81ad988b 100644 --- a/include/users.h +++ b/include/users.h @@ -75,7 +75,10 @@ class UserResolver : public Resolver userrec* bound_user; int bound_fd; public: - UserResolver(userrec* user, std::string to_resolve, bool forward) : Resolver(to_resolve, forward), bound_user(user) { }; + UserResolver(userrec* user, std::string to_resolve, bool forward) : Resolver(to_resolve, forward), bound_user(user) + { + this->bound_fd = user->fd; + } void OnLookupComplete(const std::string &result); void OnError(ResolverError e); diff --git a/src/users.cpp b/src/users.cpp index b6317a3f0..58e1f9103 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -48,6 +48,7 @@ extern time_t TIME; extern userrec* fd_ref_table[MAX_DESCRIPTORS]; extern ServerConfig *Config; extern user_hash clientlist; +extern Server* MyServer; whowas_users whowas; @@ -141,6 +142,7 @@ void userrec::StartDNSLookup() { log(DEBUG,"Commencing forward lookup"); res_reverse = new UserResolver(this, insp_ntoa(this->ip4), false); + MyServer->AddResolver(res_reverse); } void UserResolver::OnLookupComplete(const std::string &result) @@ -149,7 +151,8 @@ void UserResolver::OnLookupComplete(const std::string &result) { log(DEBUG,"Commencing reverse lookup"); this->bound_user->stored_host = result; - bound_user->res_reverse = new UserResolver(this->bound_user, result, true); + bound_user->res_forward = new UserResolver(this->bound_user, result, true); + MyServer->AddResolver(bound_user->res_forward); } else if ((this->fwd) && (fd_ref_table[this->bound_fd] == this->bound_user)) { |