summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-12 12:58:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-12 12:58:56 +0000
commit45fe5e1683e170056bb70854ad7893edac89cfbc (patch)
tree38580e9ddb26e3a1992d44f5d6ac4660e4447e2d /src
parent8c52db0ea867375053cb9bcb20b6b632a3beeecb (diff)
Throw moduleexception if you:
(a) try and resolve hosts before the core is initialized (HOW?!) (b) try and resolve a host and the domain server is totally unreacable e.g. through lack of fd's or ifconfig eth0 down :p (this is the only safe way, any other way may result in a developer inserting an invalid pointer into a list of Resolver* theyre watching) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4360 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/dns.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index ce9192785..7ca1db982 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -906,6 +906,9 @@ Resolver::Resolver(const std::string &source, bool forward, const std::string &d
{
log(DEBUG,"Resolver::Resolver: RESOLVER_NSDOWN");
this->OnError(RESOLVER_NSDOWN);
+ ModuleException e("Resolver: Nameserver is down");
+ throw e;
+ /* We shouldnt get here really */
return;
}
@@ -918,6 +921,10 @@ Resolver::Resolver(const std::string &source, bool forward, const std::string &d
{
log(DEBUG,"Resolver::Resolver: RESOLVER_NOTREADY");
this->OnError(RESOLVER_NOTREADY);
+ ModuleException e("Resolver: Core not initialized yet");
+ throw e;
+ /* We shouldnt get here really */
+ return;
}
}