diff options
| author | 2006-08-02 18:44:13 +0000 | |
|---|---|---|
| committer | 2006-08-02 18:44:13 +0000 | |
| commit | e65b2c70e43882a8b4f31df78b5f9242140320f9 (patch) | |
| tree | a6cb1a4c91aec13418e8c0322be3968e71227876 /src/users.cpp | |
| parent | The great summer clean (better than a spring clean) (diff) | |
Add error messages to Resolver::OnError()
Add exception handling to several places that use Resolver (it can throw)
Remove Resolver::ProcessResult(), its now handled within the bowels of dns.cpp
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4646 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/users.cpp b/src/users.cpp index 85fd06dbe..fcdba65ca 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -137,8 +137,15 @@ bool userrec::ProcessNoticeMasks(const char *sm) void userrec::StartDNSLookup() { log(DEBUG,"Commencing reverse lookup"); - res_reverse = new UserResolver(this, insp_ntoa(this->ip4), false); - MyServer->AddResolver(res_reverse); + try + { + res_reverse = new UserResolver(this, insp_ntoa(this->ip4), false); + MyServer->AddResolver(res_reverse); + } + catch (ModuleException& e) + { + log(DEBUG,"Error in resolver: %s",e.GetReason()); + } } UserResolver::UserResolver(userrec* user, std::string to_resolve, bool forward) : Resolver(to_resolve, forward), bound_user(user) @@ -152,8 +159,15 @@ void UserResolver::OnLookupComplete(const std::string &result) { log(DEBUG,"Commencing forward lookup"); this->bound_user->stored_host = result; - bound_user->res_forward = new UserResolver(this->bound_user, result, true); - MyServer->AddResolver(bound_user->res_forward); + try + { + bound_user->res_forward = new UserResolver(this->bound_user, result, true); + MyServer->AddResolver(bound_user->res_forward); + } + catch (ModuleException& e) + { + log(DEBUG,"Error in resolver: %s",e.GetReason()); + } } else if ((this->fwd) && (fd_ref_table[this->bound_fd] == this->bound_user)) { @@ -180,7 +194,7 @@ void UserResolver::OnLookupComplete(const std::string &result) } } -void UserResolver::OnError(ResolverError e) +void UserResolver::OnError(ResolverError e, const std::string &errormessage) { if (fd_ref_table[this->bound_fd] == this->bound_user) { |
